Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Code Generation Language Standard have to be changed to ISO C++ 11
- #include <iostream>
- #include "FunctionsClass.h"
- using namespace std;
- //GLOBAL VARIABLES
- Functions call;
- int main(){
- //DEFAULT RESERVATIONS
- if(foundTextFile == 0){
- call.defaultRecords(records);
- }
- char choice;
- cout << "===============RESTAURANT RESERVATION SYSTEM II===============" << endl<<endl;
- if(foundTextFile == 0){
- cout<<"< Currently using default reservation records >"<<endl<<endl;
- }else{
- cout<<"< Current Reservation Records : "<<fileDirectory<<" >"<<endl<<endl;
- }
- cout<< "Please enter your selection" << endl <<
- "1. Import Text File Data" << endl <<
- "2. Display All Sorted by..." << endl <<
- "3. Search & Display..." << endl <<
- "4. Given...display all..." << endl <<
- "5. Exit" << endl;
- cout << "Choice: ";
- cin >> choice;
- cin.clear();
- cin.ignore(1, '\n');
- system("CLS");
- switch (choice) {
- //Display All Sorted by...
- case '1':
- cout<<"Enter 0 to return to main menu."<<endl<<endl;
- cout<<"NOTE : - Only the .txt file created from the 'Restaurant Reservation System I' can be used."<<endl
- <<" - Only "<<MAX<<" reservations are allowed."<<endl<<endl;
- cout<<"Please enter file directory of .txt file (e.g : /Users/TiffanyP/Desktop/Reservations.txt) : "<<endl;
- cin>>fileDirectory;
- if(fileDirectory != "0"){
- call.readTextFile(fileDirectory, records);
- }
- getchar();
- cout <<endl<< "Press enter to continue . . .";
- cin.clear();
- cin.ignore(1000, '\n');
- system("CLS");
- main();
- //Display All Sorted by...
- case '2':
- call.displayAll();
- main();
- //Search...
- case '3':
- call.searchNDisplay();
- main();
- //Given...display all
- case '4':
- call.givenDisplayAll();
- main();
- case '5':
- exit(1);
- default:
- cout << choice << " is not valid choice" << endl;
- main();
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment