Skip to content

Return-Ready-2021-JavaScript-Evening/JavaScript-Loops-Lab

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

JavaScript-Loops-Lab

Complete all of the problems in the LoopFun class. Descriptions and examples for each problem can be found below.

1) One to Ten

Displays the numbers 1 to 10 in the console.

Example

1
2
3
4
5
6
7
8
9
10

2) Squares

Displays the square numbers up to 100 in the console.

Example

1
4
9
16
25
36
49
64
81
100

3) Even Under N

Displays the positive even number less then n in the console

Example

n = 20

2
4
6
8
10
12
14
16
18

4) Sum

Calculates the sum of the number from n to, but not including m, and returns the answer.

Example

(5,10)

*** Output ***

35

5) Are We There Yet

Should prompt the user "Are we there yet?" until the user enters "Yes". When the user enters "Yes", the program should display "Good!" in the console and exit.

Example

"Are we there yet?"

No

"Are we there yet?"

Spoons

"Are we there yet?"

Yes

Good!

6) Triangle

Should use nested loops to produce the following pattern in the console.

Example

*
** 
*** 
**** 
***** 

7) Table Square

Should use nested loops to produce a 4x4 table square in the console.

Example

A 4 x 4 table square

| 1 |  2 |  3 |  4 |
| 2 |  4 |  6 |  8 |
| 3 |  6 |  9 | 12 |
| 4 |  8 | 12 | 16 |

8) Table Square 2

Extend your answer to the last question to produce an NxN table square in the console

Example

A 6 x 6 table square

| 1 |  2 |  3 |  4 |  5 |  6 |
| 2 |  4 |  6 |  8 | 10 | 12 |
| 3 |  6 |  9 | 12 | 15 | 18 |
| 4 |  8 | 12 | 16 | 20 | 24 |
| 5 | 10 | 15 | 20 | 25 | 30 |
| 6 | 12 | 18 | 24 | 30 | 36 |

Happy Hacking!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published