Northcentral Technical College Introduction To Programming
10-152-310
Introduction to Programming with JavaScript NTC 10-152-310

Learning Plan 4 4.2 Lab 2

# 4.2 Lab 2

#### File: /Learning Plan 4/4.2lab2.html

### Student

- Name:
- Section:
- Email:

### Lab Steps

1. Open this file in Firefox and Microsoft Visual Studio
2. Add your name, section, and email

### Lab problem statement

> Write a program that asks a user to enter a number. If the number is less than 100 then output the number and the message, " is too little!" If the number is greater than 100 then output the number and the message, " is too big!" If the number is 100 then output the number and the message, " is just right!

### Lab Steps

1. Open this file in Firefox and Microsoft Visual Studio.
2. Add your name, section, and email.
3. Add code after the line: `YOUR CODE STARTS AFTER THIS LINE:` to complete this lab.
4. Your output should look like the Example Output below.
5. Variable declarations section
   1. Write a comment that identifies this coding section.
   2. Declare a variable to hold a number.
   3. Declare a variable to hold the output message.
6. Assignments section
   1. Write a comment that identifies this coding section.
   2. Ask a user to enter a number and store it in the number variable.
   3. Convert the input to a number.
7. Calculations and Logic section
   1. Write a comment that identifies this coding section.
   2. Write 3 separate `if` statements:
      1. If the number is bigger than 100 then assign the number and " is too big!" to the message variable.
      2. If the number is less than 100 then assign the number and " is too little!" to the message variable.
      3. If the number is equal to 100 then assign the number and " is just right!" to the message variable.
8. Output section
   1. Write a comment that identifies this coding section.
   2. Output the message to the page.

### Example Output

- You'll just have one of these:

    110 is Too Big!

    45 is Too Little!

    100 is Just Right!

### Your Output:

### 4.2 Assignment 2

- Here is the exercise that goes with this lab.
  - 4.2 Assignment 2