Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. //Daniel Hong
  2. //Assignment 5
  3. //Hoenigman
  4.  
  5. #include <cstdlib>
  6. #include <iostream>
  7. #include <fstream>
  8. #include <string>
  9. #include "CommunicationNetwork.h"
  10.  
  11. using namespace std;
  12.  
  13. int main(int argc, char* argv[])
  14.  
  15. {
  16. CommunicationNetwork ntwk;
  17. int input;
  18. string cityInput, previous, cityNameDelete;
  19.  
  20.  
  21. while (true)
  22. {
  23. cout << "======Main Menu======" << endl;
  24. cout << "1. Build Network" << endl;
  25. cout << "2. Print Network Path" << endl;
  26. cout << "3. Transmit Message Coast-To-Coast-To-Coast" << endl;
  27. cout << "4. Add City" << endl;
  28. cout << "5. Delete City" << endl;
  29. cout << "6. Clear Network" << endl;
  30. cout << "7. Quit" << endl;
  31. cin >> input;
  32.  
  33.  
  34. switch (input)
  35. {
  36. case 1:
  37. ntwk.buildNetwork();
  38. break;
  39. case 2:
  40. ntwk.printNetwork();
  41. break;
  42. case 3:
  43. ntwk.transmitMsg(argv[1]);
  44. break;
  45. case 4:
  46. cin.ignore();
  47. cout << "Enter a city name: " << endl;
  48. getline (cin, cityInput);
  49. cout << "Enter a previous city name: " << endl;
  50. getline (cin, previous);
  51. ntwk.addCity(previous, cityInput);
  52. break;
  53. case 5:
  54. cout << "Enter a city name: " << endl;
  55. getline (cin, cityNameDelete);
  56. ntwk.deleteCity(cityNameDelete);
  57. break;
  58. case 6:
  59. ntwk.clearNetwork();
  60. break;
  61. case 7:
  62. cout << "Goodbye!" << endl;
  63. return 0;
  64. default:
  65. cout << "Wrong choice" << endl;
  66. }
  67.  
  68. }
  69.  
  70. return 0;
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement