Pizzeria
Enviado por joab38 • 1 de Octubre de 2015 • Tarea • 698 Palabras (3 Páginas) • 127 Visitas
Página 1 de 3
Pizzas en c++
- #include
- using namespace std;
- int main (){
- int bucle = 1;
- int tipo = 0;
- int consinextra = 0;
- int total = 0;
- int pizzaqueso = 5; //poner aqui el precio la pizza de queso.
- int pizzaatum = 5; //poner aqui el precio la pizza de atum.
- int extra = 2; //poner aqui precio de los extras
- cout << "cual el la pizza, 1 o 2?" << endl;
- cin>>tipo;
- while ( bucle ){
- switch ( tipo ){
- case 1:
- total += pizzaqueso;
- cout << "Le gustaria añadir extras? por " << extra << " euros mas";
- cout << endl;
- cout <<"1 si\n" << "2 no" << endl;
- cout << endl;
- cin>>consinextra;
- if ( consinextra == 1)
- total = total + extra;
- break;
- if ( consinextra == 2)
- break;
- case 2:
- cout << "lo haces tu la de atum XD" << endl;
- default:
- break;
- }
- cout << "Total: " << total << " euros." << endl;
- cout << "Quiere seguir comprando mas?" << endl;
- cout << "1 si\n" << "2 no" << endl;
- cin>>bucle;
- if ( bucle == 0 )
- bucle = 1;
- if ( bucle == 2 )
- break;
- }
}
...
Disponible sólo en Clubensayos.com