Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Chapter 9 defined the struct studentType to implement the basic properties of a student. Define the class studentType with the same components as the struct

Chapter 9 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 6 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: setFirstName(string val) : getFirstName()
lastName: setLastName(string val) : getLastName()
courseGrade: setGrade() : getGrade()
testScore: setTestScore(int val) : getTestScore()
programmingScore: setProgScore(int val) : getProgScore()
GPA: setGPA(double val) : getGPA()
An example of the program is shown below:
Name: Sara Spilner
Grade: A
Test score: 89
Programming score: 92
GPA: 3.57
***************

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

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

=+ Is the information source free from bias on the subject?

Answered: 1 week ago

Question

=+ Is the information source knowledgeable about the subject?

Answered: 1 week ago

Question

=+2. How will it be used?

Answered: 1 week ago