Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void get_packages() {
- vector<int> package_indexes;
- vector<string> Route_28;
- string one_package_in;
- bool continue_scanning = true;
- cout << "Input the packges." << endl;
- cout << "Input \"stop\" to stop." << endl;
- Route_28 = populate_route_28(Route_28);
- do {
- getline(cin, one_package_in);
- if (one_package_in == "stop")
- continue_scanning = false;
- for (unsigned int package_index = 0; package_index < Route_28.size(); ++package_index) {
- if (one_package_in == Route_28[package_index])
- package_indexes.push_back(package_index);
- }
- if (find(Route_28.begin(), Route_28.end(), one_package_in) == Route_28.end(), one_package_in != "stop")
- cout << "Package is not on this route. Check your spelling." << endl;
- } while (continue_scanning);
- sort(package_indexes.begin(), package_indexes.end());
- for (unsigned int i = 0; i < package_indexes.size(); ++i)
- cout << "Stop " + to_string(i) + ": " + Route_28[package_indexes[i]] << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement