diff --git a/Timetable system b/Timetable system new file mode 100644 index 0000000..241107d --- /dev/null +++ b/Timetable system @@ -0,0 +1,137 @@ +#include + +#include + +#include + + + +using namespace std; + + + +void CreateMenu(void) + +//Display user menus + +{ + + cout << "Options available:" << endl; + + cout << "1. Find class by time" << endl; + + cout << "2. Find class by room" << endl; + + cout << "3. Find class by lecturer" << endl; + + cout << "9. Exit" << endl; + + cout << "Enter option 1 or 2 or 3:"; + +} + + + +bool ListClassbyTime(void) + +{ + + cout << "class by time" << endl; + + CreateMenu(); + + return true; + +} + + + +bool ListRooms(void) + +{ + + cout << "class by room" << endl; + + CreateMenu(); + + return true; + +} + + + +bool ListLecturers(void) + +{ + + cout << "class by lecturer" << endl; + + CreateMenu(); + + return true; + +} + + + +void main(void) + +{ + + string option; + + bool loopprompt = true; + + + + //Display options to the user to select + + CreateMenu(); + + while (loopprompt) + + { + + cin >> option; + + switch (stoi(option)) + + { + + case 1: + + ListClassbyTime(); + + break; + + case 2: + + ListRooms(); + + break; + + case 3: + + ListLecturers(); + + break; + + case 9: + + cout << "Exit" << endl; + + loopprompt = false; + + default: + + if (loopprompt) + + cout << "Choose option 1-3 or 9" << endl; + + break; + + } + + } + +}