Skip to content
Permalink
bf6f672e2d
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
137 lines (62 sloc) 1.58 KB
#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;
}
}
}