Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Emphasis Heading 1 Heading 2 Heading 3 Heading 4 He 12 13 14 15 16 17 Define a class called Course with private data members
Emphasis Heading 1 Heading 2 Heading 3 Heading 4 He 12 13 14 15 16 17 Define a class called Course with private data members code, title, credit, fee, and grade. The class has the public member functions set(string code, string title, int credit) which reads the fee and the grade, getEeco, getCredi0etrade0, print), a default constructor, and a constructor with parameters. Define a class called Person with private data members name, age, and budget. The class has the public member functions set(string name, int age) which reads the budget, get(string &, int &, int &), print(), a default constructor, and a constructor with parameters. De fine a class called Student which publicly inherits the class Person and has the private data members department, uumberCouses, tuition (the sum of all courses fee), living of type Utilities, and expenditures (sum of tuition, food, housing and books). The class has the public member functions set(string name, int age, string department, int numberotCourses), print), a default constructor, and a constructor with parameters Implement all member functions of the three classes enforcing the least privileged principle and the principle of information hiding. Use the following driver: int main Student someOne"Ali Omar", 19, "Computer Science", 5); return 0; Sample input/output Enter the budget of Ali Omar: 57880 nter information of 5 courses Enter the course code, title, credit: 1411110 IT English, 3 nter the course fee and grade: 4860 A Enter the course code, title, credit: 1411113 Programming for Engineers,3 Enter the course fee and grade: 45ee c nter the course code, title, credit: 1411116 Programming I, 4 nter the course fee and grade: 5566 B nter the course code, title, credit: 1411211 Programming II,i3 nter the course fee and grade: 4566 B er the course code, title, credit: 1411215 Java Programming. 3 nter the course fee and grade: 456e c er the cost of food, housing, and books; 350 500 3500 The person name is: Al1 Omar The person age is: 19 and budget is 57600 The student is in Computer Science department and studied 5 courses at the total cost of 35000
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started