- Open this file in your browser and Microsoft Visual Studio
- Add your name, section, and email
- Add code after the line:
YOUR CODE STARTS AFTER THIS LINE: to complete this lab.
- Your output should look like the Example Output below.
- Variable declarations section
- Write a comment that starts the variable declaration section. (Something like "
// Variable declarations" would work!)
- Create a variable named
total with no initial assignment.
- Create a variable named
numberOne that is assigned to 10 when you declare the variable.
- Create a variable named
numberTwo that has no initial assignment.
- Create a variable named
numberThree that has no initial assignment.
- Assignments section
- Write a comment that starts the coding section. (How about "
// Assignments Section"?)
- Assign 25 to
numberTwo.
- Use the
prompt() function to get a number from the user and assign the value to numberThree.
- Then convert numberThree to a number.
- Calculations section
- Write a comment that identifies this coding section. (Maybe "
// Calculations"?)
- Add the three numbers and assign the results to the total variable.
- Output section
- Write a comment that identifies this coding section. (This would work: "
// Output".)
- Display all three numbers and the total on the page.
Example Output
numberOne: 10
numberTwo: 25
numberThree: 100
total: 135
Your Output: