CSC264 Computer Organization & Architecture II
Lab 2
Annual Rainfall
Input
This lab uses 10 years of monthly rainfall data: the rainfall totals
from New Brunwick from January 2013 through December 2022. You can find a float array
with the rainfall amounts (120 entries) in the lab2 folder in Files
on Canvas.
The average annual rainfall in New Brunswick is 49.5 inches.
Processing
Use this data to do the following:
- create a float array that contains the yearly rainfall in inches
- create a float array that contains the yearly rainfall in centimeters
- print the year and the rainfall total for the year with the lowest rainfall
- print the year and the rainfall total for the year with the highest rainfall
- print the number of years with below average rainfall
- print the number of years with above average rainfall
Output
Print a table with year, rainfall in inches, and rainfall in centimeters.
Your table should have a heading, such as:
year rain (inches) rain (cm)
2013 xxxxxx xxxxxx
2014 xxxxxx xxxxxx
etc
After the table, print the summary information, with labels:
xxxx: lowest annual rainfall of xx.xx inches
xxxx: highest annual rainfall of xx.xx inches
number of years with below average rainfall: xx
number of years with above average rainfall: xx
Notes
- There is no way to tell the syscall how many places to print after
the decimal point. I understand if this bothers you, but you have to
live with it.
- Remember your comments should reflect the purpose of the statements.
Write comments like "$f6 is rain in cm" not comments like "$f6 = $f4 * $f2".
- Don't be stubborn and wait to put in your comments till the end. It
will be a lot easier if you do. Remember it's
very important to comment your
register usage.
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2023