Giter Site home page Giter Site logo

while-e-coyote's Introduction

while-e-coyote

An assignment with while loops.

number-summer.js

In a file called number-summer.js file, write a program that continually prompts the user for numbers until the user enters the keyword "done" at which point the sum of all the inputted numbers is logged out.

Example

Enter some numbers (type 'done' when complete):
> 20
> 10
> 3.2
> done

Those numbers sum to 33.2

fibonacci.js

Write a program, fibonacci.js that accepts a number, n, from the user and consequently logs the first n values in the fibonacci sequence.

The fibonacci sequence starts with 0 then 1. Each subsequent value can be obtained by summing the previous two values:

0 1 1 2 3 5 8 13 21 34 ...

Example

Enter a value for "n":
> 9

0
1
1
2
3
5
8
13
21

number-doubler.js

Write a program that prompts the user for a number, then repeatedly doubles that number until it is greater than or equal to 100.

Example

Enter a number:
> 23

23
46
92
184

string-repeater.js

Write a program that takes a string and 'repeats it' until the string's length is greater than or equal to 10.

Examples

Enter a string:
> abc

abc
abcabc
abcabcabc
abcabcabcabc
Enter a string:
> a

a
aa
aaa
aaaa
aaaaa
aaaaaa
aaaaaaa
aaaaaaaa
aaaaaaaaa
aaaaaaaaaa

make-divisble.js

Write a program that prompts the user for two numberx, x and y. The program should add one to x until it is divisble by y.

Examples

Enter x: 
> 9
Enter y: 
> 1

9 is divisible by 1



Enter x: 
> 9
Enter y: 
> 2

9
10 is divisible by 2



Enter x: 
> 10
Enter y: 
> 3

10
11
12 is divisible by 3



Enter x: 
> 5
Enter y: 
> 4

5
6
7
8 is divisible by 4

while-e-coyote's People

Contributors

alexcrist avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.