Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Daniel Hong
- //Assignment 5
- //Hoenigman
- #include <cstdlib>
- #include <iostream>
- #include <fstream>
- #include <string>
- #include "CommunicationNetwork.h"
- using namespace std;
- int main(int argc, char* argv[])
- {
- CommunicationNetwork ntwk;
- int input;
- string cityInput, previous, cityNameDelete;
- while (true)
- {
- cout << "======Main Menu======" << endl;
- cout << "1. Build Network" << endl;
- cout << "2. Print Network Path" << endl;
- cout << "3. Transmit Message Coast-To-Coast-To-Coast" << endl;
- cout << "4. Add City" << endl;
- cout << "5. Delete City" << endl;
- cout << "6. Clear Network" << endl;
- cout << "7. Quit" << endl;
- cin >> input;
- switch (input)
- {
- case 1:
- ntwk.buildNetwork();
- break;
- case 2:
- ntwk.printNetwork();
- break;
- case 3:
- ntwk.transmitMsg(argv[1]);
- break;
- case 4:
- cin.ignore();
- cout << "Enter a city name: " << endl;
- getline (cin, cityInput);
- cout << "Enter a previous city name: " << endl;
- getline (cin, previous);
- ntwk.addCity(previous, cityInput);
- break;
- case 5:
- cout << "Enter a city name: " << endl;
- getline (cin, cityNameDelete);
- ntwk.deleteCity(cityNameDelete);
- break;
- case 6:
- ntwk.clearNetwork();
- break;
- case 7:
- cout << "Goodbye!" << endl;
- return 0;
- default:
- cout << "Wrong choice" << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement