- 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 identifies this coding section.
- Add the following variables:
addTotal
subtractTotal
total
numberOne
numberTwo
numberThree
numberFour
- Assignments section
- Write a comment that identifies this coding section.
- Prompt the user for a number and set it to
numberOne.
- Repeat this for the next three numbers.
- Convert the entered strings to numbers in-place.
- Calculations section
- Write a comment that identifies this coding section.
- Add
numberOne to numberTwo and put the results into addTotal.
- Subtract
numberFour from numberThree and put the results into subtractTotal.
- Add
addTotal and subtractTotal and put the results into total.
- Output section
- Write a comment that identifies this coding section.
- Display
addTotal and subtractTotal on their own lines with labels.
- Display
total on its own line with a label.
Example Output
addTotal: 456
subtractTotal: 111
total: 567
Your Output: