Source of TestStuff20141008Lab.cpp


  1: //TestStuff20141008Lab.cpp

  2: //Wednesday, October 8, 2014

  3: 
  4: #include <iostream>

  5: #include <fstream>

  6: #include <iomanip>

  7: #include <string> 

  8: #include <cstdlib>

  9: #include <vector>

 10: using namespace std;
 11: 
 12: #include "utilities.h"

 13: using Scobey::Pause;
 14: using Scobey::ReadInt;
 15: using Scobey::ReadString;
 16: using Scobey::userSaysYes;
 17: using Scobey::Menu;
 18: using Scobey::RandomGenerator;
 19: 
 20: void BuildMenu
 21: (
 22: Menu& menu //inout

 23: );
 24: 
 25: int main(int argc, char* argv[])
 26: {
 27:     Menu menu;
 28:     BuildMenu(menu);
 29:     int menuChoice;
 30:     do
 31:     {
 32:         menu.display();
 33:         menuChoice = menu.getChoice();
 34:         switch (menuChoice)
 35:         {
 36:         case -1:
 37:         case 1:
 38:             Pause(0, "Program terminating.");
 39:             break;
 40:         case 2:
 41:             Pause(0, "Here is some information ...");
 42:             break;
 43:         case 3:
 44:             RandomGenerator randGen;
 45:             for (int i = 1; i <= 10; i++)
 46:             {
 47:                 cout << randGen.getNextString("xxxx....13578642") << endl;
 48:             }
 49:             Pause();
 50:             break;
 51:         }
 52: 
 53:     } while (menuChoice != 1 && menuChoice != -1);
 54: }
 55: 
 56: void BuildMenu
 57: (
 58: Menu& menu //inout

 59: )
 60: {
 61:     menu.setTitle("Menu");
 62:     menu.addOption("Quit");
 63:     menu.addOption("Get info");
 64:     menu.addOption("Generate some random strings");
 65: }