Code Monkey home page Code Monkey logo

javascript-loops-lab's Introduction

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!

javascript-loops-lab's People

Contributors

kburd avatar

Watchers

James Cloos 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.