|CPSC 120 LAB 14||Back to Lab index page|
Lab must be completed and reviewed by Peer Instructor Seth Peery no later than Fri, Dec 7 during lab class.
You will write a nicely documented
Ada program that will read scores and student names from a file. You may assume
there will be three scores for each student. Assign these data elements to an
array of records. Calculate the average score for each student. Then print the
student name and average. Also calculate and display the class average.
There can be up to 15 students. Names can be up to 19 characters.
You should prepare an input file like the following:
75 82 95 Smith
66 91 55 Jones
75 59 92 Cotton
82 89 73 Cornelius
Output of the program based on the sample input should look like:
Class average is: 77.9
Store the names, scores, and average for each student in an array of records:
Type scarray is array(1..3) of float;
Type sturec is record
Type starray is array (1..15) of sturec;
Input - Use the End_of_File function in the loop that gets the data (no exception handling necessary). Count the number of students in the input loop.
Output - Display the names and average scores, one per line. Display the class average.