CS 1401 Introduction to Computer Science
Fall 2013, Lab 8

Objective. The purpose of this lab is to practice arrays.

Assignment. The more a student studies for the class, the better chances of success. A usual university norm is that for each hour in class, a student must study 3.5 hours at home. Let us write a program that would help a student analyze how much he or she studied.

The program should ask for a student's name, number of days, and then for the number of hours studied on each day. Place these numbers-of-hours into an array hours of the corresponding size. Based on the values stored in this array, compute:

After computations, the program should print a report containing the student's name and these three numbers.

Example: Let us assume that the student Luc Kay-Vladik studied for 23 hours on Day 1 (this was before the test), for 0 hours on Day 2 (too tired and sleepy), and 3 hours on Day 3. In this case, the average number of hours is (23 + 0 + 3)/3 = 8.67, the largest was 23, the smallest was 0. The report should then look something like this:

Dear Luc Kay-Vladik,

Here are the statistics about your study time:
* on average, you studied for 8.67 hours/day
* your largest study time was 23 hours
* your smallest study time was 0 hours.

Good luck on your next test!

For extra credit: make the computations of average, largest value, and smallest value separate methods.

When it is due. The program is due at the beginning of the first lab section on the week of October 28, i.e.: