Final program for CIS67 - Fall 96 1. Declare a record student as described below: data stored: name - a string scores - an array of 3 test scores average - average of 3 scores grade - letter grade functions for a student record: read with file argument (type stream) and type student argument - reads one student's name and 3 scores from an input stream (could be cin) void read_student (istream& ins, student& stu) { getline(ins, stu.name, '\n'); ins >> stu.scores[0] >> stu.scores[1] >> stu.scores[2]; ins.ignore (100, '\n'); // skip end of line mark } The function call cout << "Type in the student data: " << endl; cout << "Type in a name of first line and then 3 scores:"; read_student(cin, one_stu); prompts for and reads the data into student one_stu from cin (the keyboard). The function call read_student(infile, my_best_stu); reads the data from stream infile into my_best_stu (no prompt required). These functions need to have a student& argument. They change one field of the student argument. comp_ave(student&) - computes average score of 3 scores that have been stored for a student. Finds the average of the 3 scores that have been stored. As an example, the follwing function defines the average incorrectly based on just the first exam score: void comp_ave(student& a_stu) { stu.average = stu.scores[0]; // incorrect comp_ave function. } set_grade(student&) - sets a student's grade using a standard scale (A is 90-100, B is 80 - 89, etc.) based on the average which has been computed and stored. change_score (student&, int) - changes an exam score for a student. The function user will indicate which of the three scores (0, 1, or 2) should be changed. write_stu(ostream&, student&) - writes a student's data to an output stream (could be cout). See discussion of read_student. 2. Write a program that uses an array to store all data about a section of students. Write functions that use the functions above to do the following operations. 1. Read all student data from a stream into an array of students. For simplicity, assume the number of student is the first data item in the stream. 2. Read and append a new student record to the end of the array 3. Compute average grades for all students 4. Assign letter grades to all students 5. Change a score for a specified student and recompute average and grade (user enters student number and score number). 6. Display a specified student record (user enters the student number) 6.1 Display a specified student record (user enters the student name) 7. Display all student records on the screen 8. Write the student records to a file 9. Sort the records in the array in decreasing order by score. 10. Sort the records in the array in alphabetical order by name. You should do this in stages. End of week 1 (April 16): Steps 1, 7, 8 End of week 2: (April 23) Steps 2, 3, 4, End of week 3: (April 30) Steps 5, 6, 6.1, 9, 10 Write a menu-driven program that tests all these functions. Those who want to earn an A in the course can do more than this. For extra credit, set up a separate header file to hold the definition of the student struct and the function prototypes. More extra credit. Define a class student with private data members and member functions that perform all the operations listed for a student record. Write a client program that uses these member functions to do tasks 1 -10. (See chapter 11 or me for ideas about this.)