Computer Science and Programming - Fall 2009

 

Lab. 10 [Maximum points – 30]

 

For demonstration and submission by end of the lab.

 

Given the following declaration:

 

struct examStats

{

            int studentID;

            int scores[3];

            float average;

            char grade;

};

 

examStats aStudent;

 

Write a program to read the studentID and scores for aStudent. Calculate the average score and assign a letter grade based on a straight scale (90-100 an A, 80-89 a B, 70-79 a C, 60-69 a D, otherwise F).

Display the final values of all the fields of aStudent.