What do you all think?? =]
- Code: Select all
#include <iostream>
using namespace std;
//Checkout thing by Aaron McNuggets
bool exitprog = false;
int beer_int = 0;
int cake_int = 0;
int bannana_int = 0;
int apple_int = 0;
int xbox_int = 0;
int ps_int = 0;
int wii_int = 0;
int dc_int = 0;
int price = 0;
int checkout()
{
while ( beer_int > 0 ) { price+=3; beer_int--; }
while ( cake_int > 0 ) { price+=5; cake_int--; }
while ( bannana_int > 0 ) { price+=1; bannana_int--; }
while ( apple_int > 0 ) { price+=1; apple_int--; }
while ( xbox_int > 0 ) { price+=400; xbox_int--; }
while ( ps_int > 0 ) { price+=650; ps_int--; }
while ( wii_int > 0 ) { price+=250; wii_int--; }
while ( dc_int > 0 ) { price+=150; dc_int--; }
cout << "Total price: $" << price << endl;
cout << "Thank you come again!" << endl;
cout << "Press enter to restart :)";
price = 0;
cin.get();
cin.get();
}
int what_you_have_bought(int shop)
{
if (shop == 1) { beer_int++; }
if (shop == 2) { cake_int++; }
if (shop == 3) { bannana_int++; }
if (shop == 4) { apple_int++; }
if (shop == 5) { xbox_int++; }
if (shop == 6) { ps_int++; }
if (shop == 7) { wii_int++; }
if (shop == 8) { dc_int++; }
system("cls");
cout << "(1) - Beer's ($3) = " << beer_int << endl;
cout << "(2) - Cake's ($5) = " << cake_int << endl;
cout << "(3) - Bannana's ($1) = " << bannana_int << endl;
cout << "(4) - Apples's ($1) = " << apple_int << endl;
cout << "(5) - Xbox 360's ($400) = " << xbox_int << endl;
cout << "(6) - PS3's ($650) = " << ps_int << endl;
cout << "(7) - Wii's ($250) = " << wii_int << endl;
cout << "(8) - Dreamcast's ($150) = " << dc_int << endl;
}
int purchase_function(int shop)
{
if (shop == 1) { cout << "Beer\n"; }
if (shop == 2) { cout << "Cake\n"; }
if (shop == 3) { cout << "Bannana\n"; }
if (shop == 4) { cout << "Apples\n"; }
if (shop == 5) { cout << "Xbox 360\n"; }
if (shop == 6) { cout << "PS3\n"; }
if (shop == 7) { cout << "Wii\n"; }
if (shop == 8) { cout << "Dreamcast\n"; }
if (shop == 10) { checkout(); }
what_you_have_bought(shop);
}
int main()
{
system("color 1a");
while ( exitprog == false ) {
int shop = 0;
what_you_have_bought(shop);
cout << "\nChoose items to put in trolly or type 10 to go to checkout\n";
cin >> shop;
purchase_function(shop);
}
}
.......Yes, you don't need to point it out, I spelt banana wrong... lol
