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.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
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.
Struct studentType:
struct studentType {
string firstName;
string lastName;
char courseGrade;
int testScore;
int programmingScore;
double GPA;
};
An example of the program is shown below:
Name: Sara Spilner
Grade: A
Test score: 89
GPA: 3.57
***************
--
Please solved code? I can't seem to do it correctly. Thanks.
Let us see the code :-
Step by step
Solved in 2 steps