Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int brownie = 45, pedido, total, opcion;
- while(true){
- system("cls");
- cout << "Cuantos brownies quiere pedir?" << endl;
- cin >> pedido;
- if(pedido > 5 && pedido <= 10){
- brownie = 40;
- total = brownie * pedido;
- cout << "Usted tiene que pagar RD$" << total << endl;
- }
- else if(pedido > 10 && pedido <= 25){
- brownie = 35;
- total = brownie * pedido;
- cout << "Usted tiene que pagar RD$" << total << endl;
- }
- else if(pedido > 25 || pedido <= 0){
- cout << "Valor invalido" << endl;
- pedido = 0;
- total = 0;
- continue;
- }
- system("cls");
- cout << "Desea seguir ordenando?" << endl;
- cout << "1. Si /n2. No" << endl;
- cout << "Opcion: ";
- cin >> opcion;
- if(opcion == 1){
- continue;
- }
- else{
- return 0;
- }
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement