// file header comment here #include #include "order1.H" #include "pizza1.H" int main ( ) { // print a greeting cout << "Welcome to UMBC Pizza take-out!" << endl << endl; // get the order details Order order; // input caller's name string name; cout << "What's your name?"; getline (cin, name); order.SetName (name); // input phone number string phone; cout << "What's your phone number?"; getline (cin, phone); order.SetPhone (phone); // input number of sodas int nrSodas; cout << "How many sodas?"; cin >> nrSodas; order.SetNrSodas (nrSodas); // input number of breadsticks int sticks; cout << "How many breadsticks?"; cin >> sticks; order.SetNrBreadSticks (sticks); // input number of pizzas int nrPizzas; cout << "How many pizzas?"; cin >> nrPizzas; cin.ignore(); // if pizzas ordered, ask if list // of toppings should be displayed if (nrPizzas != 0) { string yn; cout << "List of Toppings?"; getline (cin, yn); if (yn == "yes") { Pizza pizza; pizza.ListToppings (); } } // get the size and toppings details for each pizza for (int i = 0; i < nrPizzas; i++) { string size; Pizza pizza; // force reconstruction and initialization // input pizza size cout << "What size for Pizza #" << i + 1 << "?"; getline (cin, size); pizza.SetSize (size); // input number of toppings int nrToppings; cout << "How many toppings for Pizza #" << i + 1 << "?"; cin >> nrToppings; cin.ignore(); // input the type of toppings for (int i = 0; i < nrToppings; i++) { string topping; cout << "Topping #" << i + 1 << ":"; getline(cin, topping); pizza.SetTopping (topping); } // add the pizza to the order order.SetPizza (pizza); } // print the order including the pizzas cout << order; }