Introduction To Programming
10-152-310

Learning Plan 3 : Math and Operators

Student

  • Name:
  • Section:
  • Email:

Lab Steps

  1. Open this file in your browser 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 starts the variable declaration section. (Something like "// Variable declarations" would work!)
    2. Create a variable named total with no initial assignment.
    3. Create a variable named numberOne that is assigned to 10 when you declare the variable.
    4. Create a variable named numberTwo that has no initial assignment.
    5. Create a variable named numberThree that has no initial assignment.
  6. Assignments section
    1. Write a comment that starts the coding section. (How about "// Assignments Section"?)
    2. Assign 25 to numberTwo.
    3. Use the prompt() function to get a number from the user and assign the value to numberThree.
    4. Then convert numberThree to a number.
  7. Calculations section
    1. Write a comment that identifies this coding section. (Maybe "// Calculations"?)
    2. Add the three numbers and assign the results to the total variable.
  8. Output section
    1. Write a comment that identifies this coding section. (This would work: "// Output".)
    2. Display all three numbers and the total on the page.

Example Output

        numberOne: 10
        numberTwo: 25
        numberThree: 100
        total: 135

Your Output: