Question: C + + Instructions Chapter 9 defined the struct studentType to implement the basic properties of a student. Define the class studentType with the same
C
Instructions
Chapter defined the struct studentType to implement the basic properties of a student. Define the class studentType with the same components as the struct studentType, and add member functions to manipulate the data members. Note that the data members of the class studentType must be private.
Write a program to illustrate how to use the class studentType.
The studentType struct needs to have data members in total. All fields except courseGrade should be set by passing a parameter into the set function. The course grade should reflect their performance in the two categories testScore and programmingScore. Anytime setGrade is called, it should be set to the average of these two scores. Do not pass in a parameter when calling setGrade.
Struct studentType:
struct studentType string firstName; string lastName; char courseGrade; int testScore; int programmingScore; double GPA; ;
Implement the following member functions
firstName: setFirstNamestring val : getFirstName lastName: setLastNamestring val : getLastName courseGrade: setGrade : getGrade testScore: setTestScoreint val : getTestScore programmingScore: setProgScoreint val : getProgScore GPA: setGPAdouble val : getGPA
An example of the program is shown below:
Name: Sara Spilner Grade: A Test score: Programming score: GPA:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
