C++ Programming assignment help

computer science

Description

CPSC 1375 

Programming I 

HW4 

(A classical "single control break" problem

The results of a series of quizzes in a certain course are in the data file "quizzes.dat". A typical record in this file consists of a student's ID number (of type int) and a quiz score (also of type int) for the student. The file is arranged so that all the records for a particular student are lumped together; to illustrate, the first few records in the file are: 

67 100 53 

quiz scores for student # 10234 

in no 

quiz scores for student # 11245 

99 

10234 10234 10234 10234 11245 11245 11245 14652 14652 14652 14652 14652 14652 1983

100 56 99 100 9

quiz scores for student # 14652 Note that the number of quizzes a student has taken can vary! 

Your job is to write a C++ program to loop through this file and, for each student, output the student's ID number along with the student's quiz average after the highest and lowest quiz scores for the student has been thrown out. Thus, in our example, the first few lines of your output should look lik

10234 11245 14652 

79.00 89.00 93.Programming notes: 

(1). In outputting, format the averages to two decimal-place accuracies. Also keep in mind that "integer division truncates", i.e., remember to use "casts". (2). You can assume that everyone in the file has taken at least three quizzes, i.e., you need not worry about "dividing by zero" 

(continued on back) page 2 

after the maximum and minimum grades have been thrown out. 

(3). Note that you should throw out only one occurrence of the maximum and not all occurrences. (See student # 14652 above.) A similar statement applies to minimum grades. (4). A programming hint: Make a "special case" out of the first record in the file by reading it in separately, and then, in your main loop, read records and react accordingly depending on whether the ID field is different or the same as the previous ID inputted. 



Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.