Hi, Long time lurker, first time poster! Basically here is my assignment, number 3
http://books.google.com/books?id=20xVrpISzoYC&lpg=PA27&ots=llLlOPBIRL&dq=cout%20%3C%3C%20%22this%20is%20Exercise%2016.%22%3C%3C%20endl%3B%20%20%20%20cout%20%3C%3C%20%22In%20C%2B%2B%2C%20the%20multiplication&pg=PA638#v=onepage&q&f=false
and so far here is what I got, and I really am stuck on this, if you can help would be great:
#include <iostream>
#include <string>
#include <iomanip>
#include <list>
using namespace std;
struct menuItemType
{
string menuItem;
double menuPrice;
};
void getData(menuItemType placepicks[9]);
void printCheck(menuItemType printpicks[]);
void showMenu();
int main()
{
showMenu();
menuItemType menuList[9];
menuItemType picks[9];
getData(picks);
printCheck(picks);
return 0;
}
void showMenu()
{
cout << "______ Resturant - The Menu for Today" << endl;
cout << "1.Plain Egg-----1.45" << endl;
cout << "2.Bacon and Egg-2.45" << endl;
cout << "3.Muffin--------0.99" << endl;
cout << "4.French Toast--1.99" << endl;
cout << "5.Fruit Basket--2.49" << endl;
cout << "6.Cereal--------0.69" << endl;
cout << "7.Coffee--------0.50" << endl;
cout << "8.Tea-----------0.75" << endl;
cout << "9. DONE" << endl;
}
void getData(menuItemType placepicks[9])
{
menuItemType menuList[9];
menuList[0].menuItem = "Plain Egg";
menuList[1].menuItem = "Bacon and Egg";
menuList[2].menuItem = "Muffin";
menuList[3].menuItem = "French Toast";
menuList[4].menuItem = "Fruit Basket";
menuList[5].menuItem = "Cereal";
menuList[6].menuItem = "Coffee";
menuList[7].menuItem = "Tea";
menuList[8].menuItem = "Done";
menuList[0].menuPrice = 1.45;
menuList[1].menuPrice = 2.45;
menuList[2].menuPrice = 0.99;
menuList[3].menuPrice = 1.99;
menuList[4].menuPrice = 2.49;
menuList[5].menuPrice = 0.69;
menuList[6].menuPrice = 0.50;
menuList[7].menuPrice = 0.75;
menuList[8].menuPrice = 0.00;
cout << "Whaddya have today? Pick a number " <<endl;
int answer;
for(answer = 0; answer < 7; answer++)
{ cin >> menuList[answer];
if(menuList[answer] = 8)
break;
}
}
void printCheck(menuItemType printpicks[])
{
const double rateOfTax = 0.05;
int a = 0;
double amountDue = 0;
double tax;
cout << endl;
cout << "heres your order " << endl;
cout << endl;
/* display the orders with the price*/
// show the total price//
//multiply the total price to .05, add those together and then show the final price//
}