Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
timetabling/main.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
68 lines (56 sloc)
1.73 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "functions.h" | |
using namespace std; | |
void Lecturer_upload(){ | |
int lecturer_number; | |
string Lecturer_name, Lecturer_id; | |
cout<< "Enter Lecturer's name"<<endl; | |
cin>>Lecturer_name; | |
cout<< "Enter ID"<<endl; | |
cin>>Lecturer_id; | |
cout<< "Enter the lecturer's phone number"<<endl; | |
cin>>lecturer_number; | |
AddNewLecturers(Lecturer_id, Lecturer_name, lecturer_number); | |
} | |
void student_upload(){ | |
int student_number,student_id; | |
string student_name; | |
cout<< "Enter student's name"<<endl; | |
cin>>student_name; | |
cout<< "Enter ID"<<endl; | |
cin>>student_id; | |
cout<< "Enter phone number"<<endl; | |
cin>> student_number; | |
AddNewStudents(student_id, student_name, student_number); | |
} | |
int main(){ | |
int press=0; | |
int code; | |
cout<< "Welcome to University timetable system."<<endl; | |
cout<< "To look at the lecturers list, press 1\n To look at the students list, press 2 \n If you would like to upload the details of a new lecturer, press 3 then press enter\n If you want to upload details of a student, press 4\n If you want to look for a lecturer a module, press 5 \n To exit, press 6"<<endl; | |
cin>>press; | |
if (press==1){ | |
showAllLecturers(); | |
} | |
else if (press==2){ | |
showAllStudents(); | |
} | |
else if (press==3){ | |
Lecturer_upload(); | |
} | |
else if (press==4){ | |
student_upload(); | |
} | |
else if (press==5){ | |
cout<< "Please enter the module code to look for the lecturer"<<endl; | |
cin>>code; | |
Search_for_lect(code); | |
} | |
else if (press==6){ | |
return 0; | |
} | |
else { | |
cout<< "Invalid input entered"<<endl; | |
return 0; | |
} | |
return 1; | |
} |