Skip to content

Instantly share code, notes, and snippets.

@crumblingstatue
Last active August 29, 2015 14:02
Show Gist options
  • Save crumblingstatue/60e6335e78b71fecce7c to your computer and use it in GitHub Desktop.
Save crumblingstatue/60e6335e78b71fecce7c to your computer and use it in GitHub Desktop.
---
# BasedOnStyle: LLVM
AccessModifierOffset: -4
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: false
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BinPackParameters: true
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: false
DerivePointerBinding: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 120
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerBindsToType: false
SpacesBeforeTrailingComments: 1
Cpp11BracedListStyle: false
Standard: Cpp11
IndentWidth: 4
TabWidth: 4
UseTab: Never
BreakBeforeBraces: Attach
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
...
#include <iostream>
using namespace std;
int menu();
int menu1();
int menu2();
int menu3();
int menu4();
int menu5();
string Name1, Name2, Name3, Name4, Name5, Name6, Name7, Name8, Name9, Name10,
Name11, Name12, Name13, Name14, Name15, Name16, Name17, Name18, Name19,
Name20, Name21, Name22, Name23, Name24, Name25, Name26, Name27, Name28,
Name29, Name30;
void Hour1(), Hour2(), Hour3(), Hour4(), Hour5(), Hour6(), Hour7(), Hour8(),
Hour9(), Hour10();
void Hr1(), Hr2(), Hr3(), Hr4(), Hr5(), Hr6(), Hr7(), Hr8(), Hr9(), Hr10();
void H1(), H2(), H3(), H4(), H5(), H6(), H7(), H8(), H9(), H10();
void Monday();
void Tuesday();
void Wednesday();
void Thursday();
void Friday();
int main() {
bool exit = false;
for (;;) {
int choice = menu();
switch (choice) {
case(1) :
Monday();
break;
case(2) :
Tuesday();
break;
case(3) :
Wednesday();
break;
case(4) :
Thursday();
break;
case(5) :
Friday();
break;
default:
cout << "''Look at the menu again!''";
continue;
} // end switch
if (exit)
break;
}
return 0;
}
int menu() {
int choice;
cout << " *** Day from the week ***";
cout << "(1) Monday";
cout << "(2) Tuesday";
cout << "(3) Wednesday";
cout << "(4) Thursday";
cout << "(5) Friday";
cout << "Please select a day: ";
cin >> choice;
return choice;
}
int menu1() {
int choice;
cout << "*** Hour ***";
cout << "(1) 10:00-11:00"
<< ": " << Name1 << " " << Name2 << " " << Name3 << " ";
cout << "(2) 11:00-12:00"
<< ": " << Name4 << " " << Name5 << " " << Name6 << " ";
cout << "(3) 12:00-13:00"
<< ": " << Name7 << " " << Name8 << " " << Name9 << " ";
cout << "(4) 13:00-14:00"
<< ": " << Name10 << " " << Name11 << " " << Name12 << " ";
cout << "(5) 14:00-15:00"
<< ": " << Name13 << " " << Name14 << " " << Name15 << " ";
cout << "(6) 15:00-16:00"
<< ": " << Name16 << " " << Name17 << " " << Name18 << " ";
cout << "(7) 16:00-17:00"
<< ": " << Name19 << " " << Name20 << " " << Name21 << " ";
cout << "(8) 17:00-18:00"
<< ": " << Name22 << " " << Name23 << " " << Name24 << " ";
cout << "(9) 18:00-19:00"
<< ": " << Name25 << " " << Name26 << " " << Name27 << " ";
cout << "(10) 19:00-20:00"
<< ": " << Name28 << " " << Name29 << " " << Name30 << " ";
cout << "Please select hour: ";
cin >> choice;
return choice;
}
int menu2() {
int choice;
cout << "*** Hour ***";
cout << "(1) 10:00-11:00";
cout << "(2) 11:00-12:00";
cout << "(3) 12:00-13:00";
cout << "(4) 13:00-14:00";
cout << "(5) 14:00-15:00";
cout << "(6) 15:00-16:00";
cout << "(7) 16:00-17:00";
cout << "(8) 17:00-18:00";
cout << "(9) 18:00-19:00";
cout << "(10) 19:00-20:00";
cout << ": ";
cin >> choice;
return choice;
}
int menu3() {
int choice;
cout << "*** Hour ***";
cout << "(1) 10:00-11:00";
cout << "(2) 11:00-12:00";
cout << "(3) 12:00-13:00";
cout << "(4) 13:00-14:00";
cout << "(5) 14:00-15:00";
cout << "(6) 15:00-16:00";
cout << "(7) 16:00-17:00";
cout << "(8) 17:00-18:00";
cout << "(9) 18:00-19:00";
cout << "(10) 19:00-20:00";
cout << ": ";
cin >> choice;
return choice;
}
void Monday() {
bool exit = false;
for (;;) {
int choice = menu1();
switch (choice) {
case(1) :
Hour1();
break;
case(2) :
Hour2();
break;
case(3) :
Hour3();
break;
case(4) :
Hour4();
break;
case(5) :
Hour5();
break;
case(6) :
Hour6();
break;
case(7) :
Hour7();
break;
case(8) :
Hour8();
break;
case(9) :
Hour9();
break;
case(10) :
Hour10();
break;
default:
cout << "Look at the menu again!";
continue;
}
if (exit)
break;
}
}
void Tuesday() {
bool exit = false;
for (;;) {
int choice = menu2();
switch (choice) {
case(1) :
Hour1();
break;
case(2) :
Hour2();
break;
case(3) :
Hour3();
break;
case(4) :
Hour4();
break;
case(5) :
Hour5();
break;
case(6) :
Hour6();
break;
case(7) :
Hour7();
break;
case(8) :
Hour8();
break;
case(9) :
Hour9();
break;
case(10) :
Hour10();
break;
default:
cout << "Look at the menu again!";
continue;
}
if (exit)
break;
}
}
void Wednesday() {
bool exit = false;
for (;;) {
int choice = menu3();
switch (choice) {
case(1) :
Hour1();
break;
case(2) :
Hour2();
break;
case(3) :
Hour3();
break;
case(4) :
Hour4();
break;
case(5) :
Hour5();
break;
case(6) :
Hour6();
break;
case(7) :
Hour7();
break;
case(8) :
Hour8();
break;
case(9) :
Hour9();
break;
case(10) :
Hour10();
break;
default:
cout << "Look at the menu again!";
continue;
}
if (exit)
break;
}
}
void Thursday() {
bool exit = false;
for (;;) {
int choice = menu3();
switch (choice) {
case(1) :
Hour1();
break;
case(2) :
Hour2();
break;
case(3) :
Hour3();
break;
case(4) :
Hour4();
break;
case(5) :
Hour5();
break;
case(6) :
Hour6();
break;
case(7) :
Hour7();
break;
case(8) :
Hour8();
break;
case(9) :
Hour9();
break;
case(10) :
Hour10();
break;
default:
cout << "Look at the menu again!";
continue;
}
if (exit)
break;
}
}
void Friday() {
bool exit = false;
for (;;) {
int choice = menu3();
switch (choice) {
case(1) :
Hour1();
break;
case(2) :
Hour2();
break;
case(3) :
Hour3();
break;
case(4) :
Hour4();
break;
case(5) :
Hour5();
break;
case(6) :
Hour6();
break;
case(7) :
Hour7();
break;
case(8) :
Hour8();
break;
case(9) :
Hour9();
break;
case(10) :
Hour10();
break;
default:
cout << "Look at the menu again!";
continue;
}
if (exit)
break;
}
}
void Hour1() {
cout << "Please enter a name: ";
cin >> Name1;
cout << menu1();
cout << "Please enter a name: ";
cin >> Name2;
cout << menu1();
cout << "Please enter a name: ";
cin >> Name3;
cout << menu1();
}
void Hour2() {
cout << "Please enter a name: ";
cin >> Name4;
cout << menu1();
cout << "Please enter a name: ";
cin >> Name5;
cout << menu1();
cout << "Please enter a name: ";
cin >> Name6;
cout << menu1();
}
void Hour3() {
cout << "Please enter a name: ";
cin >> Name7;
cout << menu1();
cout << "Please enter a name: ";
cin >> Name8;
cout << menu1();
cout << "Please enter a name: ";
cin >> Name9;
cout << menu1();
}
void Hour4() {
cout << "Please enter a name: ";
cin >> Name10;
cout << menu1();
cout << "Please enter a name: ";
cin >> Name11;
cout << menu1();
cout << "Please enter a name: ";
cin >> Name12;
cout << menu1();
}
void Hour5() { cout << "Please enter a name: "; }
void Hour6() { cout << "Please enter a name: "; }
void Hour7() { cout << "Please enter a name: "; }
void Hour8() { cout << "Please enter a name: "; }
void Hour9() { cout << "Please enter a name: "; }
void Hour10() { cout << "Please enter a name: "; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment