1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#include <iostream>
#include <string>
#include "Sandwhich.h"
using namespace std;
const int ROWS = 10, COLS = 40;
char MENU[ROWS][COLS] = {
"#######################################",
"# M E N U #",
"# BREAD: MEAT: CHEESE: DRINK: #",
"# white ham swiss soda #",
"# wheat turkey cheddar water #",
"# flat salami jack ice tea #",
"# steak #",
"# #",
"# Thanks for choosing Hoagie's! #",
"#######################################",
};
void displayMenu(char menu[ROWS][COLS]);
void showOrder(Sandwhich order);
int main()
{
string bread, cheese, meat, drink;
int orders;
double price = 0;
displayMenu(MENU);
cout << "What type of bread do you want? ";
getline(cin, bread);
cout << endl << "Cheese? ";
getline(cin, cheese);
cout << endl << "Meat? ";
getline (cin, meat);
cout << endl << "Drink? ";
getline(cin, drink);
cout << endl << "How many orders? ";
cin >> orders;
Sandwhich Order_1(bread, cheese, meat, drink, orders, price);
Order_1.calculatePrice();
showOrder(Order_1);
return 0;
}
void displayMenu(char menu[ROWS][COLS]) {
for (int i = 0; i < ROWS; i++) {
for (int j = 0; j < COLS; j++)
{
cout << menu[i][j];
}
cout << endl;
}
cout << endl;
}
void showOrder (Sandwhich& order) {
cout << "Your Order: ";
cout << order.getBread() + ", " + order.getMeat() + ", " +
order.getCheese() + ", " + order.getDrink()
<< endl;
cout << "Your Price: " << order.getPrice() << endl;
}
|