I Need the Universitycpp file for this assignment Write a pr
I Need the University.cpp file for this assignment.
Write a program that implements a small university. The university has the following components: Department, Student, Faculty, and Course. The property of each component is outlined as follows:
Department:
-id (long)
-name (string)
-location (string)
-chairId (long)
-nextDepartId (static long)
Course:
-CRN (long)
-maxAvaliableSeats (integer)
-name (string)
-departId (long)
-assignedSeats (long)
-isTaughtBy (long)
-nextCRN (static long)
Student:
-id (long)
-name (string)
-email (string)
-address (string)
-dateOfBirth (string)
-gender (string)
-yearOfStudy (integer)
-major (string)
-advisorId (long)
-coursesTaken (vector of courses taken by a student)
-nextStId (static long)
Faculty:
-id (long)
-name (string)
-email (string)
-address (string)
-dateOfBirth (string)
-gender (string)
-salary (float)
-yearOfExp (intger)
-departId (long)
nextFacultyId (static long) // initialize it to 600
Each of the above components becomes a class of its own. You can provide set() and get() functions in order to assign values or retrieve the values of the attributes. Further, each class should have constant print method that simply prints the values of the attributes on the screen.
The pseudo code for the University class is provided. Print that and use that class in your program.
Your main program is written for you. It calls a method in the University class to read a transaction file and process its commands. The transaction file contains several commands and values. The commands and their formats are:
CreateNewDepartment depName depLoc depChairId
RemoveADepartment depId
CreateNewStudent Name Email Address DateOfBirth
Gender YearOfStudy Major AdvisorId
RemoveAStudent StId
CreateNewCourse Name DepId TaughtBy MaxSeat
RemoveACourse CRN
CreateNewFaculty Name Email Address DateOfBirth
Gender Salary YearOfExp DepId
RemoveAFaculty FactId
ListCoursesTaughtByFaculty facultyId
ListCoursesTakenByStudent studentId
ListFacultiesInDepartment departId
ListStudentsOfAFaculty facultyId
ListCoursesOfADepartment departId
AddACourseForAStudent courseId stId
DropACourseForAStudent courseId stId
AssignDepartmentChair facultyId departId
AssignInstructorToCourse facultyId courseId
ListDepartments
ListStudents
ListCourses
ListFaculties
As you see there are 17 different commands. Some commands come with other parameters. For example, if your program detects the command “CreateNewDepartment”, you should expect three values associated with depName, depLoc, and depChairId. Similary if your program detects the command “CreateNewFaculty”, you should expect 8 values associated with this command: Name, Email, Address, DateOfBirth, Gender, Salary, YearOfExp, and DepId.
Do the following:
-Run your program against the provided transaction file
-Make sure to break up your classes into .cpp and .h files
-All of your classes must have at least one constructor
-There is a lot of common attributes between faculty and students, create a new super class (parent class) to place the common attributes in there and make the Student class and Faculty class to inherit the attributes of that super class
Solution
#inclide <iostream>
#include <conio.h>
class Details
{
public : long int id;
int DOB;
char name[20], gender[2], email[30], address[30];
}
class Faculty : : Details
{
int Faculty();
float salary;
long department id;
int year of exp;
void read();
void display();
};
void : : Faculty()
{
cout<<\"this is faculty details\";
}
void faculty : : read()
{
cout<<\"enter faculty name\";
cin>>name;
cout<<\" enter faculty address \";
cin>>address ;
cout<<\" enter faculty email \";
cin>>email;
cout<<\"enter faculty gender\";
cin>>gender;
cout<<\"enter salary\";
cin>>salary;
}
void Faculty : : display()
{
cout<<\"Faculty name is\"<<name<<endl;
cout<<\"faculty address is\"<<address<<endl;
cout<< \"faculty email is\"<<email<<endl;
cout<<\"the gender is\"<<gender<<endl;
cout<<\"faculty salary is\"<<salary<<endl;
}
class Student : : Details
{
int student();
int year of student;
long advisor id;
char course taken, major;
}
void Student : : Student()
{
cout<<\" this is student deatails\";
}
void Student : : read()
{
cout<<\"enter the student name \";
cin>>name;
cout<<\"enter the student id \";
cin>> id;
cout<< \"enter student address \";
cin>> address;
cout<< \"enter email id \";
cin>>email;
cout<< \"year of student\";
cin>> student;
cout<<\"gender\";
cin>> gender;
cout<<\"course taken\";
cin>> course taken;
}
void Student : : disp()
{
cout<<\" student name is\"<<name<<endl ;
cout<<\" student id is \"<< id<<endl;
cout<<\"student address is\"<<address<<endl;
cout<<\" email id is\"<<email<<endl;
cout<<\" year of student is\"<<student<<endl;
cout<<\" gender is \"<<gender<<endl;
cout<<\" course taken is\"<<course taken<<endl;
}
void main()
{
Student s;
clrscr();
s.read();
S.display();
Faculty f;
clrscr()
f.read();
f.display();
getch();
}
getch();





