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

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

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