You will need to create several classes to maintain this information: Course, Person, Student, Faculty, and Date. The characteristics of Students and Faculty are shown below: Students: Faculty: ID...



You will need to create several classes to maintain this information:
Course, Person, Student, Faculty, and Date.



The characteristics of Students and Faculty are shown below:



Students: Faculty:


ID (string) ID (string)


First Name (string) First Name (string)


Last Name (string) Last Name (string)


Birthdate (Date) Birthdate (Date)


Date enrolled (Date) Date hired (Date)


Major (string) Title (string)


Level (string) (i.e. Freshman, Sophomore…) Rank (string)


GPA (double) Salary (double)



Several of the data members above require the use of dates. Strings will not be acceptable substitutes for date fields.



C++ does not have a built in data type for Date. Therefore, you may use this Date class in your program:


#pragma once


#include


#include


#include


class Date{


friend std::ostream& operator


public:



Date(int d=0, int m=0, int yyyy=0) {



setDate(d, m, yyyy);



}



~Date() {}



void setDate(int d, int m, int yyyy){



day = d;



month = m;



year = yyyy;



}


private:



int day;



int month;



int year;


};


std::ostream& operator



output



return output;


}




Person

class (base class)


The Person class should contain data members that are common to both Students and Faculty.


Write appropriate member functions to store and retrieve information in the member variables above. Be sure to include a constructor and destructor.




Student

class andFacultyclass. (derived classes)


Both the
Student
and
Faculty
classes should be derived from the
Person
class. Each should have the member variables shown above that are unique to each class. The data members that are common to both classes should be inherited from thePersonclass.


In each derived class, theto output, neatly formatted, all of the information associated with a student or faculty member.


Theshould be overloaded in the
Student
class to enable sorting of the vector ofStudentobjects that will exist in theCourseclass. You will use the
sort
function to sort this vector. The
sort
function is part of the

algorithm>
library.


Write member functions to store and retrieve information in the appropriate member variables. Be sure to include a constructor and destructor in each derived class.




Course

class


TheCourseclass has a
name
data member (i.e. a course’s name might be “CSIS 112”).


The class contains a
Faculty object
that represents the Faculty member assigned to teach the class.


The class contains a
vector of Student objects
that represent the students enrolled in the class.


The class has an integer variable,
capacity
, that represents the maximum number of students that can be enrolled in the class.


TheCourseclass should support operations to assign a faculty member to the course, enroll students in the course, and list all of the course information, including its name, capacity, instructor, and students enrolled in it.



Main()


You should write a
main
() function that begins by prompting the user for the name and capacity of a course:


It should then present a menu (output) to the user that have


Main Menu


I--Add Instruct


S--Add Studnt


L--List Course Information


Q--Quit


Selection:



“S”should allow the user to create a Student record and enroll the Student in the Course. Likewise, “I” should allow the user to create an Instructor (aka Faculty) record and assign the Faculty member to the course as the instructor. “
L

should list ALL of the course information, including all of the information about the Students assigned to the course, (sorted by ID number), as well as all of the information about the faculty member assigned to teach the course. The user should be able to create and assign only ONE faculty member to teach the course, but create and enroll as many Students to the course as the capacity allows. The user should be able to list repeatedly until he or she selects “
Q
” to quit.


1.
Create and assign a faculty member as the instructor:




2.Result of listing Course Information before assigning any students to the course




3.Create and assign a student to the course:


4.
List of Course Information after assigning two students: ( it should output information of the faculty member created earlier and below it the information of 2 students


5.
Output if neither students nor an instructor has been assigned to the course:




6.Output if Students have been enrolled but no instructor has been assigned:


7.
Output if the class is full and the user tries to add another student:


There are several things to point out about the output:



  1. For each Student, the first name and last name are output on the same line, separated by a space.

  2. For the instructor, the format should be this: title [space] first name [space] last name [comma] rank

  3. All of the data should line up in neat columns as shown above.



Other helpful hints:


Use good coding style and principles for all code and input/output formatting. All data in a class must be
private
(not publicnor protected).


You may find the
tokenizeDate
function below to be useful in reading in and manipulating dates. Using the
strtok_s
function that you learned in a previous assignment, you can read in Date values as a character array, and then tokenize each part into a meaningful day, month, and year that can be used to initialize a Date variable:


You can put tokenizeDate in any class that you deem appropriate.

Feb 26, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here