Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Section 1 [60 marks] Write a program that reads student's IDs and exam scores (type int) for a particular exam in a course from each

image text in transcribedimage text in transcribed
Section 1 [60 marks] Write a program that reads student's IDs and exam scores (type int) for a particular exam in a course from each line of an input file (the input file is included). You need to compute the average of these scores and assign grades to each student according to the following regulation: If a student's score is within 10 points (above or below) of the average, assign a grade of satisfactory. If a student's score is more than 10 points above average, the grade will be outstanding. If a student's score is more than 10 points below the average, the grade will be unsatisfactory. The output of your program should consist of a three-column table that shows each ID, score, and corresponding grade. A sample output is shown below. D Score Grade 75 Satisfactory 99 Outstanding Unsatisfactory Unsatisfactory Outstanding Unsatisfactory Satisfactory Outstanding Satisfactory Satisfactory Write necessary functions and put them in a module to process this data such that the program 1. [40%] Reads each data line from the text file into array scores. / READS EXAM SCORES INTO ARRAY SCORES void readStuData (ifstream& rss, IN: Raw scores data stream int scores , OUT: The data read int id , OUT: the IDs int& count, OUT: Number of students processed bool& tooMany ) ; OUT : A flag to indicate that more than maxSize scores are in input file. 2. [15%] Computes average of the count of student scores / COMPUTES AVERAGE OF THE COUNT OF STUDENT SCORES float mean (int scores [ ] IN: student data int count) ; // IN: count of students 3. [30%] Displays a table showing each student's ID, score and grade on a separate line PRINTS A TABLE SHOWING EACH STUDENT' SCORE AND GRADE ON A SEPARATE LINE // Uses printGrade void printTable (int scores [ ] INOUT: student data int ID , INOUT: student's ID int count IN: count of students 4. [15%] Prints student grade after comparing oneScore (one student score) to average. / PRINTS STUDENT GRADE AFTER COMPARING oneScore TO AVERAGE void printGrade (int oneScore, IN: one student score float average) ; average score3. [30%] Displays a table showing each student's ID, score and grade on a separate line S PRINTS A TABLE SHOWING EACH STUDENT'S SCORE AND GRADE ON A SEPARATE LINE // Uses printGrade void printTable (int scores , 7/ INOUT: student data int ID[ ] , // INOUT: student's ID int count) IN: count of students 4. [15%] Prints student grade after comparing oneScore (one student score) to average. // PRINTS STUDENT GRADE AFTER COMPARING oneScore TO AVERAGE void printGrade (int oneScore, / / IN: one student score float average) ; / / IN: average score Section 2 [40 marks] Now, redo the previous project described in Section 1 using a struct to store each student's data and an array of structs to store the whole class. The struct should have a data member for id, score, and grade

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

6-10 Do you accept or decline the invitation?

Answered: 1 week ago