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:

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



Email Me | Office Hours | My Home Page | Department Home | MCC Home Page

© Copyright Emmi Schatz 2023