Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- void main()
- {
- int codigo, tiempo, tipopizza, cantgratis, contgrande;
- int contfam, contsuperfam,mayor, contmost, contdel;
- char tipopedido;
- float importetotal, importe, tiempodel, tiempomost;
- cantgratis = contgrande = contsuperfam = contfam = 0;
- contdel = contmost = 0;
- importetotal = tiempodel = tiempomost = 0;
- do
- {
- do
- {
- cout << "ingrese el codigo(4digitos) o 0 para fin: ";
- cin >> codigo;
- } while ((codigo < 1000 || codigo>9999) && (codigo != 0));
- do
- {
- cout << "ingrese tipo de pizza(1,2,3): ";
- cin >> tipopizza;
- } while (tipopizza < 1 || tipopizza>3);
- do
- {
- cout << "ingrese tipo de pedido(D o M): ";
- cin >> tipopedido;
- tipopedido = toupper(tipopedido);
- } while (tipopedido != 'D'&& tipopedido != 'M');
- do
- {
- cout << "ingrese tiempo de etrega: ";
- cin >> tiempo;
- } while (tiempo < 1);
- if (tipopizza == 1)
- {
- importe = 50;
- contgrande++;
- }
- else
- if (tipopizza ==
- 2)
- {
- importe = 60;
- contfam++;
- }
- else
- {
- importe = 68;
- contsuperfam++;
- }
- if (tipopedido == 'D')
- {
- if (tiempo > 30)
- {
- cantgratis++;
- cout << "importe a pagar : Gratis/n ";
- }
- else
- {
- contdel++;
- tiempodel += tiempo;
- importetotal += importe;
- cout << "importe a pagar: " << importe << endl;
- }
- }
- else
- {
- if (tiempo > 20)
- {
- cantgratis++;
- cout << "importe a pagar : Gratis\n ";
- }
- else
- {
- contmost++;
- tiempomost += tiempo;
- importetotal += importe;
- cout << "importe a pagar: " << importe << endl;
- }
- }
- } while (codigo!=0);
- cout << "importe total el ultimo mes " << importetotal << endl;
- cout << "cantidad de pedidos entregados gratis: " << cantgratis << endl;
- mayor = contgrande;
- if (contfam > mayor)mayor = contfam;
- if (contsuperfam > mayor)mayor = contsuperfam;
- cout << "la pizza con mayor demanda es :\n ";
- if (mayor == contgrande)cout << "Grande\n";
- if (mayor == contfam)cout << "Familiar\n";
- if (mayor == contsuperfam)cout << "Super Familiar\n";
- cout << "tiempo de entrega promedio por cada tipo:\n";
- if (contdel > 0)
- cout << "Delivery: " << tiempodel / contdel << endl;
- else
- cout << "Delivery: 0\n";
- if (contmost > 0)
- cout << "Mostrador: " << tiempomost / contmost << endl;
- else
- cout << "Mostrador: 0";
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement