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

Example Output

        addTotal: 456
        subtractTotal: 111
        total: 567
        

Your Output: