Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
137 additions
and
0 deletions.
There are no files selected for viewing
137
Timetable system
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
#include <iostream> | ||
|
||
#include <string> | ||
|
||
#include <sstream> | ||
|
||
|
||
|
||
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; | ||
|
||
} | ||
|
||
} | ||
|
||
} |