Question: can you provide code for this, I would like to use it as reference to figure out what I'm missing on my end. I need

can you provide code for this, I would like to use it as reference to figure out what I'm missing on my end. I need the full code. if you are going to tell me it's to long, don't bother. that won't help me, I need the code A.S.A.P please and thank you.

can you provide code for this, I would like to use it

as reference to figure out what I'm missing on my end. I

need the full code. if you are going to tell me it's

to long, don't bother. that won't help me, I need the code

A.S.A.P please and thank you. here is the Lab7Driver.cpp if you need

it. if you don't need it, don't worry about. /* PROGRAMMER: DESCRIPTION:

Lab 7 Stage 1 (Checkpoint) This file contains code that *Declares Stage

here is the Lab7Driver.cpp if you need it. if you don't need it, don't worry about.

/* PROGRAMMER: DESCRIPTION: Lab 7 Stage 1 (Checkpoint) This file contains code that *Declares Stage 1 of the StudentRecord class interface. This code will eventually be moved to the StudentRecord.h file. *Defines Stage 1 of the StudentRecord class. This code will eventually be moved to the StudentRecord.cpp file. *Code that tests the Stage 1 StudentRecord member functions. */ #include #include #include #include #include #include

/* The class declaration code that you will write below will eventually be moved to the StudentRecord.h file. ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION !!! Be sure to use the std:: qualifier on any references to array or string data types inside the class interface. !!! */ class StudentRecord { public: //Declare the Stage-1 public constant here. //Declare the Stage-1 constructor PROTOTYPES here. //Declare the Stage-1 "get" and "set" member function PROTOTYPES here. //Declare other Stage-1 member function PROTOTYPES here. private: //Declare four Stage-1 data members here. };

using namespace std;

/* The implementation code that you will write below for the StudentRecord member functions will eventually be moved to the StudentRecord.cpp file. Don't forget to use the StudentRecord:: qualifier in front of each member function name!!! */

//Define the Stage-1 StudentRecord contructors here.

//Define the Stage-1 accessor "get" functions here.

//Define the Stage-1 mutator "set" functions here.

//Define other Stage-1 member functions here.

const int MAX_STUDENTS{ 50 };

int main() { //Create an array of 50 default StudentRecord objects. array students; fstream classDataFile("shortClassData.dat", ios::in); //The input file contains the class data

if (classDataFile.fail()) { cout

//Input the class title and number of tests given string courseTitle, consumeN; int numTests; getline(classDataFile, courseTitle); classDataFile >> numTests; getline(classDataFile, consumeN); //Consume in input stream int stuCount{ 0 }; bool inputOperationSuccessful{ false };

//Input student data do { //Construct a new StudentRecord object with data input from the classDataFile stream. //This will not be successful when the end of the file is reached. StudentRecord newStu{ numTests, classDataFile, inputOperationSuccessful }; if (inputOperationSuccessful) { //Put the newStu StudentRecord object into the next available array location. students[stuCount] = newStu; stuCount++; } } while (inputOperationSuccessful);

//Make sure data was correctly read from file. cout

system("pause"); return 0; }

In Stage 1 you should create the class declaration and implementation code for the StudentRecord class defined in the modified UML class diagram below StudentRecord Data Members Description +static const in MAX TESTS This global class constant should be initialized to 8 to indicate that the maximum number of tests that can be accommodated at this time is 8. See lines 13 and 14 of the Gradebook.h file shown in 7.9 on page 312 for how to declare and initialize a class constant. numTests contains the actual number of tests taken by the student. -int numTests string name The name of the student The scores array will hold the student's test scores. It may be only partially filled. The numTests data member field gives the actual number of tests taken by the student. array SCores double avgScore The student's average test score. This will be determined by the client program because only the client program can DO NOT DECLARE ANY OTHER DATAknow the grading scheme used in a particular course MEMBER FIELDS FOR THIS CLASS Member Function Prototypes Description "set" functions Assigns the name data member field the value of the parameter. You must choose the parameter's name. +void setName (std::string) Assigns the avgScore data member field the value of the parameter. You must choose the parameter's name. +void setAverageScore (double) The setNumTests () function should assign the numTests data member field the value of the parameter UNLESS the parameter value is not between 0 and MAX_TESTS. In that case, the setNumTests() function should throw an invalid_Argument exception passing an appropriate error message argument as shown in Time.cpp in 9.6 on page 401. You must choose the parameter's name +void setNumTests (int); The setScore () function should assign the scores [index] data member field the value of the newVal parameter UNLESS the index value is not between 0 and numTests. In that case, the setScore () function should throw an invalid Argument exception passing an appropriate error message argument. void setScore (int index, double newVal) StudentRecord continued Member Function Prototypes Description "get" functions continued +double getScore (int index) const The getScore) function should return the value in scores [index] UNLESS the index value is not between 0 and the value retumed by calling getNumtests () appropriately. In that case, the getScore) function should throw an invalid_Argument exception passing an appropriate error message argument. Other member functions void showStudent ()consti This showStudent ) function displays the StudentRecord object on the console screen as follows: Display the name, left-justified in 25 spaces. . Use the fixed and setprecision VO manipulators to assure that all scores will be displayed with exactly one digit right of the decimal point . . Use an appropriate for-loop to display right-justified in 6 spaces the value returned by calling the getSco After displaying the individual test scores, display right-justified in 6 spaces the value returned by calling the getAverageScore() function appropriately followed by endl re () function appropriately End Checkpoint (Lab 7 Stage 1) Specifications Lab 7 Stage 2: Appropriately prototype and implement a member function of the StudentRecord class described below double scoreTotal) const: //member function prototype This scoreTotal function should compute and return the sum of the scores in the StudentRecord object. It should achieve this goal by calling the getScore function appropriately instead of accessing scores[?] directly. That is, we will follow Software Engineering Observation 9.5 on page 404 of 9.6.1. This function does not display anything. Add code to the main) function of Lab7Driver.cpp so that it displays the following VO session by calling the scoreTotal ) function appropriately Number of students in CS 210: 5 0 ACOSTA BRANDON M 91.868.80.0 Total score: 160.6 BOESEL MITCHALL R 98.351.70.0 Total score: 150.1 BONSEN CHLOEE 70.190.80.0 Total score: 160.9 In Stage 1 you should create the class declaration and implementation code for the StudentRecord class defined in the modified UML class diagram below StudentRecord Data Members Description +static const in MAX TESTS This global class constant should be initialized to 8 to indicate that the maximum number of tests that can be accommodated at this time is 8. See lines 13 and 14 of the Gradebook.h file shown in 7.9 on page 312 for how to declare and initialize a class constant. numTests contains the actual number of tests taken by the student. -int numTests string name The name of the student The scores array will hold the student's test scores. It may be only partially filled. The numTests data member field gives the actual number of tests taken by the student. array SCores double avgScore The student's average test score. This will be determined by the client program because only the client program can DO NOT DECLARE ANY OTHER DATAknow the grading scheme used in a particular course MEMBER FIELDS FOR THIS CLASS Member Function Prototypes Description "set" functions Assigns the name data member field the value of the parameter. You must choose the parameter's name. +void setName (std::string) Assigns the avgScore data member field the value of the parameter. You must choose the parameter's name. +void setAverageScore (double) The setNumTests () function should assign the numTests data member field the value of the parameter UNLESS the parameter value is not between 0 and MAX_TESTS. In that case, the setNumTests() function should throw an invalid_Argument exception passing an appropriate error message argument as shown in Time.cpp in 9.6 on page 401. You must choose the parameter's name +void setNumTests (int); The setScore () function should assign the scores [index] data member field the value of the newVal parameter UNLESS the index value is not between 0 and numTests. In that case, the setScore () function should throw an invalid Argument exception passing an appropriate error message argument. void setScore (int index, double newVal) StudentRecord continued Member Function Prototypes Description "get" functions continued +double getScore (int index) const The getScore) function should return the value in scores [index] UNLESS the index value is not between 0 and the value retumed by calling getNumtests () appropriately. In that case, the getScore) function should throw an invalid_Argument exception passing an appropriate error message argument. Other member functions void showStudent ()consti This showStudent ) function displays the StudentRecord object on the console screen as follows: Display the name, left-justified in 25 spaces. . Use the fixed and setprecision VO manipulators to assure that all scores will be displayed with exactly one digit right of the decimal point . . Use an appropriate for-loop to display right-justified in 6 spaces the value returned by calling the getSco After displaying the individual test scores, display right-justified in 6 spaces the value returned by calling the getAverageScore() function appropriately followed by endl re () function appropriately End Checkpoint (Lab 7 Stage 1) Specifications Lab 7 Stage 2: Appropriately prototype and implement a member function of the StudentRecord class described below double scoreTotal) const: //member function prototype This scoreTotal function should compute and return the sum of the scores in the StudentRecord object. It should achieve this goal by calling the getScore function appropriately instead of accessing scores[?] directly. That is, we will follow Software Engineering Observation 9.5 on page 404 of 9.6.1. This function does not display anything. Add code to the main) function of Lab7Driver.cpp so that it displays the following VO session by calling the scoreTotal ) function appropriately Number of students in CS 210: 5 0 ACOSTA BRANDON M 91.868.80.0 Total score: 160.6 BOESEL MITCHALL R 98.351.70.0 Total score: 150.1 BONSEN CHLOEE 70.190.80.0 Total score: 160.9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!