-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.cpp
More file actions
23 lines (19 loc) · 687 Bytes
/
Menu.cpp
File metadata and controls
23 lines (19 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "headers/Menu.h"
void Menu::showMenu() const noexcept {
cout << "Menu:" << endl;
for (int i = 0; i < menu.size(); i++)
cout << i + 1 << ": " << menu[i] << endl;
}
void Menu::showCommand(const string& command) const noexcept {
cout << command << endl;
}
bool Menu::isCorrectCommand(int command, int lower, int Upper) const noexcept {
if (command < lower || command > Upper)
return cout << "Invalid command entered!" << endl, 0;
return true;
}
bool Menu::containSpaces(const string& sentence) const noexcept {
if (sentence.find(' ') != string::npos)
return cout << "Please don't write spaces" << endl, true;
return false;
}