*** C++ ***
1.MAIN OBJECTIVE
The goal of this project is to design and implement a university administration system.
The system consists of classes of these types:
Person (Student, Teacher)
Student (B.Sc., M.Sc., Ph.D., ...)
Teacher (lecturer, adjunct, professor, ...),
Course.
Department.
You can have additional classes if required.
2. DESCRIPTION
The system should have these relationships included:
A Person should have the basic information of a person like: university ID, name, birth date, and
gender.
A student can be an undergraduate or graduate student.
A student can enroll in a course.
A graduate student can be a teaching assistant or research assistant.
A teaching assistant can be assigned to a course.
A teacher can be a lecturer, adjunct or professor.
A teacher can be assigned to a course.
Courses can be from undergraduate or graduate level.
Courses should include the grades of all students enrolled in the class.
Each teacher, student or course is assigned to a department.
3. TEST PROGRAM
The program should be tested using auxiliary files.
T eachers.txt
Students.txt
Courses.txt
Departments.txt
Each file should contain instances of the classes in the project.
The input to the system is obtained by reading these text files.
Each file should include enough instances to completely test the system’s flow of events:
Display information about Teachers
Display information about Students
Display information about Courses
Display information about Departments
Solution
/*
* Person.cpp
*
* Created on: 17-Nov-2016
* Author: kasturi
*/
#include
#include
#include
using namespace std;
#define MAX_SIZE 20
class Course
{
private:
string courseName;
int courseID;
float grades[MAX_SIZE][6];
int numofStudents;
public:
Course(int id, string name, int numOfStudents, double grade[6])
{
courseID = id;
courseName = name;
numofStudents = numOfStudents;
}
Course(int id, string name)
{
courseID = id;
courseName = name;
}
Course()
{
numofStudents = 0;
}
void addGrades(double grade[6])
{
for(int i=0; i>id>>name>>g>>courseID>>type>>deptID))
{
break;
} // error
teachers[Teachcounter] = new Teacher(id, name, g, courseID, type, deptID);
Teachcounter++;
}
infile.close();
infile.open(\"Students.txt\");
int stuCounter = 0;
while (getline(infile, line))
{
string name, type;
int id, courseID, deptID;
char g;
bool isUG;
double grades[6];
istringstream iss(line);
if (!(iss
>>id>>name>>g>>type>>courseID>>grades[0]>>grades[1]>>grades[2]>>grades[3]>>grades[4]
>>grades[5]>>deptID))
{
break;
} // error
if(type == \"UnderGraduate\")
isUG = true;
else isUG = false;
students[stuCounter] = new Student(id, name, g, courseID, isUG, grades, deptID);
stuCounter++;
}
infile.close();
//courses
int courseCount = 0;
infile.open(\"Courses.txt\");
while (getline(infile, line))
{
string name;
int id;
istringstream iss(line);
if (!(iss >>id>>name))
{
break;
} // error
course[courseCount] = new Course(id, name);
courseCount++;
}
infile.close();
//Department
int deptCount = 0;
infile.open(\"Departme.
C++ 1.MAIN OBJECTIVEThe goal of this project is to design.pdf
1. *** C++ ***
1.MAIN OBJECTIVE
The goal of this project is to design and implement a university administration system.
The system consists of classes of these types:
Person (Student, Teacher)
Student (B.Sc., M.Sc., Ph.D., ...)
Teacher (lecturer, adjunct, professor, ...),
Course.
Department.
You can have additional classes if required.
2. DESCRIPTION
The system should have these relationships included:
A Person should have the basic information of a person like: university ID, name, birth date, and
gender.
A student can be an undergraduate or graduate student.
A student can enroll in a course.
A graduate student can be a teaching assistant or research assistant.
A teaching assistant can be assigned to a course.
A teacher can be a lecturer, adjunct or professor.
A teacher can be assigned to a course.
Courses can be from undergraduate or graduate level.
Courses should include the grades of all students enrolled in the class.
Each teacher, student or course is assigned to a department.
3. TEST PROGRAM
The program should be tested using auxiliary files.
T eachers.txt
Students.txt
Courses.txt
Departments.txt
Each file should contain instances of the classes in the project.
The input to the system is obtained by reading these text files.
Each file should include enough instances to completely test the system’s flow of events:
Display information about Teachers
Display information about Students
Display information about Courses
2. Display information about Departments
Solution
/*
* Person.cpp
*
* Created on: 17-Nov-2016
* Author: kasturi
*/
#include
#include
#include
using namespace std;
#define MAX_SIZE 20
class Course
{
private:
string courseName;
int courseID;
float grades[MAX_SIZE][6];
int numofStudents;
public:
Course(int id, string name, int numOfStudents, double grade[6])
{
courseID = id;
courseName = name;
numofStudents = numOfStudents;
}
Course(int id, string name)
{
courseID = id;
courseName = name;
}
Course()
{