Create the following classes based on the given declaration. Also, each class should have the default constructor. Just place the prototype of the constructors in the class but you dont have to implement them. The default constructor is a public member. A) CSUSM is an object of class University. Class University has the follow private attributes: -UnivName: string -UnivDepts: a vector of Department class -UnivStudents: a vector of student class -UnivAddress: string -UnivAge: int B) Each department has the following private attributes: -deptName: string -deptFaculty: vector of Faculty class -deptYearCreated: int C) Each student has the following private attributes: -studName: string -studYearOfStudy: int -studNumber: long -studCoursesTaken: vector of Course class D) Each faculty has the following private attributes: -FacName: string -FacYearofExperience:int -FacId: long -FacCoursesTeaches: vector of Course Class E) Each course has the following private attributes: -courseTitle: string -courseNumber: float -courseNumOfCredits: int
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:
Create the following classes based on the given declaration. Also, each class should have the default constructor. Just place the prototype of the constructors in the class but you dont have to implement them. The default constructor is a public member.
A) CSUSM is an object of class University. Class University has the follow private attributes:
-UnivName: string
-UnivDepts: a vector of Department class
-UnivStudents: a vector of student class
-UnivAddress: string
-UnivAge: int
B) Each department has the following private attributes:
-deptName: string
-deptFaculty: vector of Faculty class
-deptYearCreated: int
C) Each student has the following private attributes:
-studName: string
-studYearOfStudy: int
-studNumber: long
-studCoursesTaken: vector of Course class
D) Each faculty has the following private attributes:
-FacName: string
-FacYearofExperience:int
-FacId: long
-FacCoursesTeaches: vector of Course Class
E) Each course has the following private attributes:
-courseTitle: string
-courseNumber: float
-courseNumOfCredits: int
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images