0% found this document useful (0 votes)
52 views12 pages

Pizza

Uploaded by

mdnlopez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views12 pages

Pizza

Uploaded by

mdnlopez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

#include <iostream>

using namespace std;

int main() {
int trans, pizza, drink, topping, bundle, pay;
int qtyCheese = 0, qtyPepperoni = 0, qtyVeggie = 0, qtyDrink = 0;
int totCheese = 0, totPepperoni = 0, totVeggie = 0, totToppings = 0, totDrinks = 0, totbill = 0,
change = 0;
int bundleDiscount = 0;

// Initial stocks for items


int stockCheese = 10, stockPepperoni = 10, stockVeggie = 10;
int stockSoda = 20, stockIcedTea = 20, stockWater = 20;
int stockCheeseTopping = 15, stockMushrooms = 15, stockBacon = 15;

cout << "******************************************************\n";


cout << "* TECHNOLOGICAL INSTITUTE OF THE PHILIPPINES *\n";
cout << "* MANILA CAMPUS *\n";
cout << "* *\n";
cout << "* MOZZAMAGIC PIZZERIA *\n";
cout << "* ORDER SYSTEM *\n";
cout << "* *\n";
cout << "* Members: CANA, Raiden Clark - BSCS *\n";
cout << "* Members: LOPEZ, Denise Nicole T. - BSCS *\n";
cout << "* Members: REBALDE, Elisha Faith - BSCS *\n";
cout << "* Instructor: Mr. Joseph Domingo *\n";
cout << "******************************************************\n";

cout << "******************************************************\n";


cout << "* BEST SELLERS STANDING FOR THE MONTH *\n";
cout << "* PIZZA *\n";
cout << "* 1. Peperoni Pizza *\n";
cout << "* 2. Cheese Pizza *\n";
cout << "* 3. Veggie Pizza *\n";
cout << "* *\n";
cout << "* DRINKS *\n";
cout << "* 1. Iced Tea *\n";
cout << "* 2. Soda *\n";
cout << "* 3. Water *\n";
cout << "* *\n";
cout << "******************************************************\n";

cout << "******************************************************\n";


cout << "* BUNDLE DEALS WITH SPECIAL DISCOUNTS! *\n";
cout << "* *\n";
cout << "* 1. Duo Deal: Any 2 Pizzas + 2 Drinks - 10% OFF *\n";
cout << "* 2. Family Feast: 3 Pizzas + 3 Drinks - 15% OFF *\n";
cout << "* 3. Party Pack: 4 Pizzas + 4 Drinks - 20% OFF *\n";
cout << "******************************************************\n";

do {
cout << "\n*********************************************";
cout << "\n MOZZAMAGIC PIZZERIA MENU";
cout << "\n 1. Pizzas";
cout << "\n 2. Drinks";
cout << "\n 3. Bundles";
cout << "\n 4. Restock Items";
cout << "\n 5. Exit";
cout << "\n*********************************************";
cout << "\n Choose Option [1-5]: ";
cin >> trans;

switch (trans) {
case 1: {
do {
cout << "\n*********************************************";
cout << "\n PIZZA MENU";
cout << "\n 1. Cheese Pizza - P200 (Stock: " << stockCheese << ")";
cout << "\n 2. Pepperoni Pizza - P250 (Stock: " << stockPepperoni << ")";
cout << "\n 3. Veggie Pizza - P180 (Stock: " << stockVeggie << ")";
cout << "\n 4. Done Choosing Pizza";

cout << "\n*********************************************";


cout << "\n Choose Pizza [1-4]: ";
cin >> pizza;

int qty = 0;
switch (pizza) {
case 1:
cout << " How many Cheese Pizzas? ";
cin >> qty;
if (qty <= stockCheese) {
stockCheese -= qty;
qtyCheese += qty;
totCheese += qty * 200;
cout << "Updated Cheese Pizza Bill = P" << totCheese << "\n";
} else {
cout << "Insufficient stock for Cheese Pizza. Please restock.\n";
}
break;
case 2:
cout << " How many Pepperoni Pizzas? ";
cin >> qty;
if (qty <= stockPepperoni) {
stockPepperoni -= qty;
qtyPepperoni += qty;
totPepperoni += qty * 250;
cout << "Updated Pepperoni Pizza Bill = P" << totPepperoni << "\n";
} else {
cout << "Insufficient stock for Pepperoni Pizza. Please restock.\n";
}
break;
case 3:
cout << " How many Veggie Pizzas? ";
cin >> qty;
if (qty <= stockVeggie) {
stockVeggie -= qty;
qtyVeggie += qty;
totVeggie += qty * 180;
cout << "Updated Veggie Pizza Bill = P" << totVeggie << "\n";
} else {
cout << "Insufficient stock for Veggie Pizza. Please restock.\n";
}
break;
default:
cout << "\n Invalid choice! Please select again.\n";
}

// Add toppings
if (pizza >= 1 && pizza <= 3) {
do {
cout << "\n*********************************************";
cout << "\n Add Toppings (Optional)";
cout << "\n 1. Extra Cheese - P50 (Stock: " << stockCheeseTopping << ")";
cout << "\n 2. Mushrooms - P30 (Stock: " << stockMushrooms << ")";
cout << "\n 3. Bacon - P70 (Stock: " << stockBacon << ")";
cout << "\n 4. Done Adding Toppings";
cout << "\n*********************************************";
cout << "\n Choose Topping [1-4]: ";
cin >> topping;

switch (topping) {
case 1:
if (stockCheeseTopping > 0) {
stockCheeseTopping--;
totToppings += 50;
cout << "Extra Cheese added! Total Toppings Bill = P" << totToppings << "\
n";
} else {
cout << "Out of stock: Extra Cheese.\n";
}
break;
case 2:
if (stockMushrooms > 0) {
stockMushrooms--;
totToppings += 30;
cout << "Mushrooms added! Total Toppings Bill = P" << totToppings << "\
n";
} else {
cout << "Out of stock: Mushrooms.\n";
}
break;
case 3:
if (stockBacon > 0) {
stockBacon--;
totToppings += 70;
cout << "Bacon added! Total Toppings Bill = P" << totToppings << "\n";
} else {
cout << "Out of stock: Bacon.\n";
}
break;
case 4:
cout << "Finished adding toppings.\n";
break;
default:
cout << "Invalid topping choice!\n";
}
} while (topping != 4);
}
} while (pizza <= 3);
break;
}
case 2: {
do {
cout << "\n*********************************************";
cout << "\n DRINKS MENU";
cout << "\n 1. Soda - P50 (Stock: " << stockSoda << ")";
cout << "\n 2. Iced Tea - P40 (Stock: " << stockIcedTea << ")";
cout << "\n 3. Water - P20 (Stock: " << stockWater << ")";
cout << "\n 4. Done Adding Drinks";
cout << "\n*********************************************";
cout << "\n Choose Drink [1-4]: ";
cin >> drink;

int qtyDrink = 0;
switch (drink) {
case 1:
cout << " How many Sodas? ";
cin >> qtyDrink;
if (qtyDrink <= stockSoda) {
stockSoda -= qtyDrink;
totDrinks += qtyDrink * 50;
cout << "Updated Drinks Bill = P" << totDrinks << "\n";
} else {
cout << "Insufficient stock for Soda. Please restock.\n";
}
break;
case 2:
cout << " How many Iced Teas? ";
cin >> qtyDrink;
if (qtyDrink <= stockIcedTea) {
stockIcedTea -= qtyDrink;
totDrinks += qtyDrink * 40;
cout << "Updated Drinks Bill = P" << totDrinks << "\n";
} else {
cout << "Insufficient stock for Iced Tea. Please restock.\n";
}
break;
case 3:
cout << " How many Bottled Waters? ";
cin >> qtyDrink;
if (qtyDrink <= stockWater) {
stockWater -= qtyDrink;
totDrinks += qtyDrink * 20;
cout << "Updated Drinks Bill = P" << totDrinks << "\n";
} else {
cout << "Insufficient stock for Water. Please restock.\n";
}
break;
case 4:
cout << "\n*********************************************";
cout << "Finished ordering drinks.\n";
cout << "*********************************************";
break;
default:
cout << "Invalid drink choice!\n";
}
} while (drink != 4);
break;
}
case 3: {
do {
cout << "\n*********************************************";
cout << "\n BUNDLE DEALS";
cout << "\n 1. Duo Deal: Any 2 Pizzas + 2 Drinks (10% OFF)";
cout << "\n 2. Family Feast: 3 Pizzas + 3 Drinks (15% OFF)";
cout << "\n 3. Party Pack: 4 Pizzas + 4 Drinks (20% OFF)";
cout << "\n 4. Done with Bundles";
cout << "\n*********************************************";
cout << "\n Choose Bundle [1-4]: ";
cin >> bundle;

switch (bundle) {
case 1: {
// Duo Deal: Any 2 Pizzas + 2 Drinks
int pizzaType1, pizzaType2, drinkType1, drinkType2, qty1, qty2, qty3, qty4;

// Choose first pizza


cout << "\nChoose first pizza type for Duo Deal:\n";
cout << "1. Cheese Pizza (P200)\n2. Pepperoni Pizza (P250)\n3. Veggie Pizza
(P180)\n";
cin >> pizzaType1;
cout << "Quantity of first pizza: ";
cin >> qty1;

// Choose second pizza


cout << "\nChoose second pizza type for Duo Deal:\n";
cout << "1. Cheese Pizza (P200)\n2. Pepperoni Pizza (P250)\n3. Veggie Pizza
(P180)\n";
cin >> pizzaType2;
cout << "Quantity of second pizza: ";
cin >> qty2;

// Choose first drink


cout << "\nChoose first drink type for Duo Deal:\n";
cout << "1. Soda (P50)\n2. Iced Tea (P40)\n3. Water (P20)\n";
cin >> drinkType1;
cout << "Quantity of first drink: ";
cin >> qty3;

// Choose second drink


cout << "\nChoose second drink type for Duo Deal:\n";
cout << "1. Soda (P50)\n2. Iced Tea (P40)\n3. Water (P20)\n";
cin >> drinkType2;
cout << "Quantity of second drink: ";
cin >> qty4;

// Calculate bundle prices


int pizzaPrice1 = (pizzaType1 == 1) ? 200 : (pizzaType1 == 2) ? 250 : 180;
int pizzaPrice2 = (pizzaType2 == 1) ? 200 : (pizzaType2 == 2) ? 250 : 180;
int drinkPrice1 = (drinkType1 == 1) ? 50 : (drinkType1 == 2) ? 40 : 20;
int drinkPrice2 = (drinkType2 == 1) ? 50 : (drinkType2 == 2) ? 40 : 20;

int bundleTotal = (qty1 * pizzaPrice1) + (qty2 * pizzaPrice2) +


(qty3 * drinkPrice1) + (qty4 * drinkPrice2);
int bundleDiscount = bundleTotal * 0.1; // 10% off
int discountedTotal = bundleTotal - bundleDiscount;

cout << "\nDuo Deal Breakdown:\n";


cout << "Original Total: P" << bundleTotal << "\n";
cout << "Discount (10%): P" << bundleDiscount << "\n";
cout << "Discounted Total: P" << discountedTotal << "\n";

totbill += discountedTotal;
break;
}
case 2: {
// Family Feast: 3 Pizzas + 3 Drinks (15% OFF)
int bundleTotal = 0;
int pizzaType1, pizzaType2, pizzaType3;
int drinkType1, drinkType2, drinkType3;
int qty1, qty2, qty3, qty4, qty5, qty6;

// Pizza selections
cout << "\n--- Family Feast: 3 Pizzas + 3 Drinks (15% OFF) ---\n";

// First pizza
cout << "Choose first pizza type:\n";
cout << "1. Cheese Pizza (P200)\n2. Pepperoni Pizza (P250)\n3. Veggie Pizza
(P180)\n";
cin >> pizzaType1;
cout << "Quantity of first pizza: ";
cin >> qty1;

// Second pizza
cout << "\nChoose second pizza type:\n";
cout << "1. Cheese Pizza (P200)\n2. Pepperoni Pizza (P250)\n3. Veggie Pizza
(P180)\n";
cin >> pizzaType2;
cout << "Quantity of second pizza: ";
cin >> qty2;

// Third pizza
cout << "\nChoose third pizza type:\n";
cout << "1. Cheese Pizza (P200)\n2. Pepperoni Pizza (P250)\n3. Veggie Pizza
(P180)\n";
cin >> pizzaType3;
cout << "Quantity of third pizza: ";
cin >> qty3;

// Drinks selections
cout << "\nChoose first drink type:\n";
cout << "1. Soda (P50)\n2. Iced Tea (P40)\n3. Water (P20)\n";
cin >> drinkType1;
cout << "Quantity of first drink: ";
cin >> qty4;

cout << "\nChoose second drink type:\n";


cout << "1. Soda (P50)\n2. Iced Tea (P40)\n3. Water (P20)\n";
cin >> drinkType2;
cout << "Quantity of second drink: ";
cin >> qty5;

cout << "\nChoose third drink type:\n";


cout << "1. Soda (P50)\n2. Iced Tea (P40)\n3. Water (P20)\n";
cin >> drinkType3;
cout << "Quantity of third drink: ";
cin >> qty6;

// Calculate bundle prices


int pizzaPrice1 = (pizzaType1 == 1) ? 200 : (pizzaType1 == 2) ? 250 : 180;
int pizzaPrice2 = (pizzaType2 == 1) ? 200 : (pizzaType2 == 2) ? 250 : 180;
int pizzaPrice3 = (pizzaType3 == 1) ? 200 : (pizzaType3 == 2) ? 250 : 180;

int drinkPrice1 = (drinkType1 == 1) ? 50 : (drinkType1 == 2) ? 40 : 20;


int drinkPrice2 = (drinkType2 == 1) ? 50 : (drinkType2 == 2) ? 40 : 20;
int drinkPrice3 = (drinkType3 == 1) ? 50 : (drinkType3 == 2) ? 40 : 20;

bundleTotal = (qty1 * pizzaPrice1) + (qty2 * pizzaPrice2) + (qty3 * pizzaPrice3) +


(qty4 * drinkPrice1) + (qty5 * drinkPrice2) + (qty6 * drinkPrice3);
int bundleDiscount = bundleTotal * 0.15; // 15% off
int discountedTotal = bundleTotal - bundleDiscount;

cout << "\nFamily Feast Breakdown:\n";


cout << "Original Total: P" << bundleTotal << "\n";
cout << "Discount (15%): P" << bundleDiscount << "\n";
cout << "Discounted Total: P" << discountedTotal << "\n";

totbill += discountedTotal;
break;
}
case 3: {
// Party Pack: 4 Pizzas + 4 Drinks (20% OFF)
int bundleTotal = 0;
int pizzaType1, pizzaType2, pizzaType3, pizzaType4;
int drinkType1, drinkType2, drinkType3, drinkType4;
int qty1, qty2, qty3, qty4, qty5, qty6, qty7, qty8;

// Pizza selections
cout << "\n--- Party Pack: 4 Pizzas + 4 Drinks (20% OFF) ---\n";

// First pizza
cout << "Choose first pizza type:\n";
cout << "1. Cheese Pizza (P200)\n2. Pepperoni Pizza (P250)\n3. Veggie Pizza
(P180)\n";
cin >> pizzaType1;
cout << "Quantity of first pizza: ";
cin >> qty1;

// Second pizza
cout << "\nChoose second pizza type:\n";
cout << "1. Cheese Pizza (P200)\n2. Pepperoni Pizza (P250)\n3. Veggie Pizza
(P180)\n";
cin >> pizzaType2;
cout << "Quantity of second pizza: ";
cin >> qty2;
// Third pizza
cout << "\nChoose third pizza type:\n";
cout << "1. Cheese Pizza (P200)\n2. Pepperoni Pizza (P250)\n3. Veggie Pizza
(P180)\n";
cin >> pizzaType3;
cout << "Quantity of third pizza: ";
cin >> qty3;

// Fourth pizza
cout << "\nChoose fourth pizza type:\n";
cout << "1. Cheese Pizza (P200)\n2. Pepperoni Pizza (P250)\n3. Veggie Pizza
(P180)\n";
cin >> pizzaType4;
cout << "Quantity of fourth pizza: ";
cin >> qty4;

// Drinks selections
cout << "\nChoose first drink type:\n";
cout << "1. Soda (P50)\n2. Iced Tea (P40)\n3. Water (P20)\n";
cin >> drinkType1;
cout << "Quantity of first drink: ";
cin >> qty5;

cout << "\nChoose second drink type:\n";


cout << "1. Soda (P50)\n2. Iced Tea (P40)\n3. Water (P20)\n";
cin >> drinkType2;
cout << "Quantity of second drink: ";
cin >> qty6;

cout << "\nChoose third drink type:\n";


cout << "1. Soda (P50)\n2. Iced Tea (P40)\n3. Water (P20)\n";
cin >> drinkType3;
cout << "Quantity of third drink: ";
cin >> qty7;

cout << "\nChoose fourth drink type:\n";


cout << "1. Soda (P50)\n2. Iced Tea (P40)\n3. Water (P20)\n";
cin >> drinkType4;
cout << "Quantity of fourth drink: ";
cin >> qty8;

// Calculate bundle prices


int pizzaPrice1 = (pizzaType1 == 1) ? 200 : (pizzaType1 == 2) ? 250 : 180;
int pizzaPrice2 = (pizzaType2 == 1) ? 200 : (pizzaType2 == 2) ? 250 : 180;
int pizzaPrice3 = (pizzaType3 == 1) ? 200 : (pizzaType3 == 2) ? 250 : 180;
int pizzaPrice4 = (pizzaType4 == 1) ? 200 : (pizzaType4 == 2) ? 250 : 180;

int drinkPrice1 = (drinkType1 == 1) ? 50 : (drinkType1 == 2) ? 40 : 20;


int drinkPrice2 = (drinkType2 == 1) ? 50 : (drinkType2 == 2) ? 40 : 20;
int drinkPrice3 = (drinkType3 == 1) ? 50 : (drinkType3 == 2) ? 40 : 20;
int drinkPrice4 = (drinkType4 == 1) ? 50 : (drinkType4 == 2) ? 40 : 20;

bundleTotal = (qty1 * pizzaPrice1) + (qty2 * pizzaPrice2) +


(qty3 * pizzaPrice3) + (qty4 * pizzaPrice4) +
(qty5 * drinkPrice1) + (qty6 * drinkPrice2) +
(qty7 * drinkPrice3) + (qty8 * drinkPrice4);
int bundleDiscount = bundleTotal * 0.20; // 20% off
int discountedTotal = bundleTotal - bundleDiscount;

cout << "\nParty Pack Breakdown:\n";


cout << "Original Total: P" << bundleTotal << "\n";
cout << "Discount (20%): P" << bundleDiscount << "\n";
cout << "Discounted Total: P" << discountedTotal << "\n";

totbill += discountedTotal;
break;
}
case 4:
cout << "Finished with Bundle Deals.\n";
break;
default:
cout << "Invalid bundle choice!\n";
}
} while (bundle != 4);
break;
}
case 4: {
// Restock menu remains the same as in the previous implementation
// ... [Restock code from previous version] ...
break;
}
case 5:
cout << "\n*********************************************";
cout << "\nThank you! Please come again!\n\n";
cout << "*********************************************";
break;
default:
cout << "\nInvalid choice! Try again.\n";
}
} while (trans != 5);

// Clear screen
system("cls");

// Calculate total bill


totbill = totCheese + totPepperoni + totVeggie + totToppings + totDrinks;

// Display summary
cout << "\n******************************************************\n";
cout << "* Summary of Purchases *\n";
cout << "* *\n";
cout << "* Cheese Pizza = P" << totCheese << " *\n";
cout << "* Pepperoni Pizza = P" << totPepperoni << " *\n";
cout << "* Veggie Pizza = P" << totVeggie << " *\n";
cout << "* Toppings = P" << totToppings << " *\n";
cout << "* Drinks = P" << totDrinks << " *\n";
cout << "* *\n";
cout << "* Total Bill = P" << totbill << " *\n";
cout << "******************************************************\n";

// Process payment
cout << " Enter Payment: ";
cin >> pay;

// Calculate change
change = pay - totbill;
if (change < 0) {
cout << "\n*********************************************";
cout << "\nInsufficient payment. Please try again.\n";
cout << "*********************************************";
} else {
cout << "\n*********************************************";
cout << "\nYour Change = P" << change << "\n";
cout << "\nThank you! Please come again!\n";
cout << "*********************************************";
}

return 0;
}

You might also like