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?
C-Database/Timetable system
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
137 lines (62 sloc)
1.58 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 <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; | |
} | |
} | |
} |