I dont know how to take what the user orders and calculate their bill. I used a class. Heres my code:
Expand|Select|Wrap|Line Numbers
- #include <iostream>
- #include <string>
- #include "Headerfile.h"
- using namespace std;
- int main ()
- {
- //This prints out the menu
- Menu ChoosingAnItem;
- ChoosingAnItem.menu();
- //This asks the user what they would like to order
- Menu ORDERING;
- ORDERING.ordering();
- struct Something {item, status, price}
- return 0;
- }
- //********************************************
- Header File
- //******************************************
- #include <string>
- #include <iostream>
- using namespace std;
- class Menu
- {
- public:
- string menu();
- string ordering();
- string removing();
- string adding();
- string printing();
- float totalPrice();
- string testing();
- private:
- string test;
- };
- //*****************************************
- Implementation file
- //*****************************************
- #include <iostream>
- #include "Headerfile.h"
- using namespace std;
- //***********************
- //This is the menu the user sees
- string Menu::menu()
- {
- string MENU;
- printf (" --Menu--\n\n");
- printf (" *Main course:\n");
- printf (" 1. Tomato Brushetta\t\t6.29\n");
- printf (" 2. Calamri Fritti\t\t8.29\n");
- printf (" 3. Pesto Chicken Pizza\t9.99\n");
- printf (" 4. Chicken Florentine\t\t9.99\n");
- printf (" 5. Eggplant Parmesan\t\t10.29\n");
- printf (" 6. Penne Rusitca\t\t13.29\n");
- printf (" 7. Veal Marsal\t\t13.99\n");
- printf (" 8. Grilled Halibut\t\t16.99\n\n");
- printf (" *Drinks:\n");
- printf (" 9. water\t\t\t2.00\n");
- printf (" 10. italian soda\t\t2.50\n");
- printf (" 11. wine\t\t\t7.50\n\n");
- return MENU;
- };
- //**********************
- string Menu::ordering()
- {
- string order;
- printf( "What would you like to order?\n" );
- return order;
- };
- //************************
- string Menu::removing()
- {
- };
- //************************