Overview
Arithmetic Operators
The goal of this lab is to increase familiarity with the basic arithmetic and output operations of Processing/Java.
Task
Calculate and output the square of each integer from 5 to 10 (inclusive). In addition, output the sum and average of the squared values (Note: the average will be a float.
If the range of numbers requested numbers were from 10 to 15, your output would look like the following:
The square of 10 is: 100
The square of 11 is: 121
The square of 12 is: 144
The square of 13 is: 169
The square of 14 is: 196
The square of 15 is: 225
The sum of the squares is: 955
The average of the 6 squares is: 159.16667
Other than the different range resulting in different numbers, your output should otherwise be formatted the same.
Turn-in Procedure
- Zip your folder, not just the source code file.
- Name the file (substituting your name): Whittinghill_David_Lab04.zip
- Refer to Lab 02, if you need a refresher on turn-in procedures.
Grading
You will be graded based on the correctness of your output. Make sure to match the sample output's format.
|