Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Resolução de exercício - 05
- Diego Mendes Rodrigues
- */
- #include <stdio.h>
- int main() {
- int bebida = 0, qtd_bebida = 0;
- int lanche = 0, qtd_lanche = 0;
- int total = 0, tempo = 0;
- printf("Selecione sua bebida\n");
- printf("1 - Sucos\t8,00\t5 min\n");
- printf("2 - Vitaminas\t12,00\t8 min\n");
- printf("Opção: ");
- scanf("%d", &bebida);
- printf("Quantidade de bebidas: ");
- scanf("%d", &qtd_bebida);
- if (bebida == 1) {
- total += (8 * qtd_bebida);
- tempo += (5 * qtd_bebida);
- } else if (bebida == 2) {
- total += (12 * qtd_bebida);
- tempo += (8 * qtd_bebida);
- }
- printf("\nSelecione seu lanche\n");
- printf("1 - Sanduíches integrais\t15,00\t8 min\n");
- printf("2 - Misto quente\t\t15,00\t10 min\n");
- printf("3 - Pastéis fritos\t\t16,00\t12 min\n");
- printf("4 - Hamburguer\t\t\t20,00\t15 min\n");
- printf("Opção: ");
- scanf("%d", &lanche);
- printf("Quantidade de lanches: ");
- scanf("%d", &qtd_lanche);
- if (lanche == 1) {
- total += (15 * qtd_lanche);
- tempo += (8 * qtd_lanche);
- } else if (lanche == 2) {
- total += (15 * qtd_lanche);
- tempo += (10 * qtd_lanche);
- } else if (lanche == 3) {
- total += (16 * qtd_lanche);
- tempo += (12 * qtd_lanche);
- } else if (lanche == 4) {
- total += (20 * qtd_lanche);
- tempo += (50 * qtd_lanche);
- }
- printf("\nValor Total a Ser Pago = %d\n", total);
- printf("Tempo de Espera = %d\n", tempo);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment