Define the class Student which has the private members name, ID, GPA, numberOfCourses, marks[] (one dimensional array of type integer to store the marks), credits[] (one dimensional array of type integer to store the credits), and calculateGPAO) a function to calculate the GPA. The class also has the public members ser), getName(), print), a default constructor, and constructor with parameters. Implement the member functions of the class Student, enforcing the least privileged principle. The following driver produces the given sample of input/output: int main() string sName, SID; int sNumOf Course: Student w w.print(); Student ("U7654321", "Ali", 3); v.print(); cout<<"Enter the ID, name, number of courses for the student" cin >> sID >> Name >> NumOfCourse; w.set(sID, sName, sNumOfCourse) w.print(); return 0; << endl; Create a project containing the class interface in a header file (Student h), the class implementation in a (Studentimp.cpp) file and the driver in a (Student.cpp) file. Sample Output: U1234567 XYZ has GPA 3 Enter marks and credits of Ali courses Mark and credit of course # 1: 80 3 Mark and credit of course # 2: 105 3 Mark and credit of course #3: 92 4 U7654321 Ali has GPA 2.5 Enter the ID, name, number of courses for the student U8765432 Omar 4 Enter marks and credits of Omar courses Mark and credit of course # 1: 72 3 Mark and credit of course # 2: 963 Mark and credit of course # 3: 82 7 Mark and credit of course # 4: 60 3 U8765432 Omar has GPA 2.33333

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question
Define the class Student which has the private members name, ID,
GPA, numberOfCourses, marks[] (one dimensional array of type integer
to store the marks), credits[] (one dimensional array of type integer to
store the credits), and calculateGPA() a function to calculate the GPA.
The class also has the public members ser().getName(), print), a default
constructor, and constructor with parameters.
Implement the member functions of the class Student, enforcing the
least privileged principle.
The following driver produces the given sample of input/output:
int main()
string sName, SID;
int sNumOfCourse;
Student w;
w.print();
Student v("U7654321", "Ali", 3);
v.print():
cout<<"Enter the ID, name, number of courses for the student"
cin >> sID >> sName >> NumOfCourse;
w.set(sID, sName, sNumOfCourse);
w.print();
return 0;
<< endl;
Create a project containing the class interface in a header file
(Student.h), the class implementation in a (StudentImp.cpp) file and the
driver in a (Student.cpp) file.
Sample Output:
U1234567 XYZ has GPA 3
Enter marks and credits of Ali courses
Mark and credit of course # 1: 80 3
Mark and credit of course # 2: 105 3
Mark and credit of course # 3: 92 4
U7654321 Ali has GPA 2.5
Enter the ID, name, number of courses for the student
U8765432 Omar 4
Enter marks and credits of Omar courses
Mark and credit of course # 1: 72 3
Mark and credit of course # 2: 963
Mark and credit of course # 3: 82 7
Mark and credit of course # 4: 60 3
U8765432 Omar has GPA 2.33333
Transcribed Image Text:Define the class Student which has the private members name, ID, GPA, numberOfCourses, marks[] (one dimensional array of type integer to store the marks), credits[] (one dimensional array of type integer to store the credits), and calculateGPA() a function to calculate the GPA. The class also has the public members ser().getName(), print), a default constructor, and constructor with parameters. Implement the member functions of the class Student, enforcing the least privileged principle. The following driver produces the given sample of input/output: int main() string sName, SID; int sNumOfCourse; Student w; w.print(); Student v("U7654321", "Ali", 3); v.print(): cout<<"Enter the ID, name, number of courses for the student" cin >> sID >> sName >> NumOfCourse; w.set(sID, sName, sNumOfCourse); w.print(); return 0; << endl; Create a project containing the class interface in a header file (Student.h), the class implementation in a (StudentImp.cpp) file and the driver in a (Student.cpp) file. Sample Output: U1234567 XYZ has GPA 3 Enter marks and credits of Ali courses Mark and credit of course # 1: 80 3 Mark and credit of course # 2: 105 3 Mark and credit of course # 3: 92 4 U7654321 Ali has GPA 2.5 Enter the ID, name, number of courses for the student U8765432 Omar 4 Enter marks and credits of Omar courses Mark and credit of course # 1: 72 3 Mark and credit of course # 2: 963 Mark and credit of course # 3: 82 7 Mark and credit of course # 4: 60 3 U8765432 Omar has GPA 2.33333
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning