CPSC 120 Assignment 5 Back to Assignment index page
Instructor: Brenneman  
   
Due Date: midnight, Tues, Oct 23  

More looping and functions

Description:  Write an well-documented/commented Ada program that calculates the final average for each student in a class.  The user should be prompted to enter the number of students in the class and the number of grades given in the class.  The user will then be prompted to enter the ID number and grades for each student.  The grades entered by the user will be integers 0 - 100.  The average grade for each student should be calculated, the average should be calculated to the nearest tenth, i.e. - 88.7.  All grades should be equally weighted.  Letter grades are assigned using a 10 point scale (i.e. 90-100 is an 'A', etc.).  You may assume that no grade will be greater than 100 or less than 0.  Your program must calculate the total class average, find the highest and lowest student averages in the class, and count the number of each type of letter grade awarded.  The output of your program should look like the following.

You will have to have the program put out prompts for the number of students and the number of graded assignments for the class.  A sample might look like:

Program Outputs Enter the number of students>
User Inputs 2
Program Outputs Enter the number of graded assignments>
User Inputs 3

You will also have to put prompts for the user to enter the id numbers and grades for each of the students. 
A sample would look like:

Program Outputs Enter student no. 1's id number>
User Inputs 123456
Program Outputs Enter grade 1 (0-100)>
User Inputs 65

and so on....

The program should output the id number and average for each student.  Sample output.

Program Outputs Student   123456      Average = 80.0

At the end of all input and computations the program should output:

The class average is 78.3.
The highest average was 94.0 while the lowest average was 38.2.
The number students with each letter grade are as follows:
2 -
5 -
14 -
2 -
0 -
A(s)
B(s)
C(s)
D(s)
F(s)

The program must utilize two functions that find the lowest and highest averages, by looking at each average as it is calculated,  that you design and implement.

The program must be in a file named program5.adb.  Use the submit command to turn in your program for grading.  Example, submit cpsc120-01 program5.adb, make sure you use the correct section number for your class.  Also, be sure the file name is program5.adb.  Do not submit executable files.   Please compile and run your program immediately before submitting it.  Never make a change to the code file(s) and turn it in without compiling and running it first.  It is very easy to make a last minute mistake that introduces syntax errors, so checking before submitting can save you an unnecessary grade of 0.  You may submit as many times as you like, but only the last submission is kept.  Since only the last submission is kept, if the last one is late, then your assignment is late and will recieve an automatic grade of zero (0).