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. myNumber
      2. mySalary
      3. year
      4. loopCounter
  6. Assignments section
    1. Write a comment that identifies this coding section.
    2. Assign the following data to the variables created in the previous section.
      1. myNumber --> 200
      2. mySalary --> 40000.00
      3. year --> 2008
      4. loopCounter --> zero
  7. Processing section
    1. Write a comment that identifies this coding section.
    2. Using ONLY compound assignment operators for the math, perform the following operations:
      1. Display the myNumber variable on the page.
      2. Add 25 to myNumber
      3. subtract 75 from myNumber
      4. Display the myNumber variable on the page.
      5. Give yourself a 10% raise (multiply your salary by 1.1)
      6. Display the mySalary variable on the page.
      7. 2008 is a leap year, what's the next one?
      8. Display the year variable on the page.
      9. Add five to the loopCounter
      10. Display the loopCounter variable on the page.

Example Output

        myNumber: 200
        myNumber: 150
        mySalary: 44000.0
        year: 2012
        loopCounter: 5

Your Output: