diegomrodrigues

Resolução de exercício - 05

Apr 17th, 2019
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.49 KB | None | 0 0
  1. /*
  2. Resolução de exercício - 05
  3. Diego Mendes Rodrigues
  4. */
  5. #include <stdio.h>
  6.  
  7. int main() {
  8.     int bebida = 0, qtd_bebida = 0;
  9.     int lanche = 0, qtd_lanche = 0;
  10.     int total = 0, tempo = 0;
  11.  
  12.     printf("Selecione sua bebida\n");
  13.     printf("1 - Sucos\t8,00\t5 min\n");
  14.     printf("2 - Vitaminas\t12,00\t8 min\n");
  15.     printf("Opção: ");
  16.     scanf("%d", &bebida);
  17.    
  18.     printf("Quantidade de bebidas: ");
  19.     scanf("%d", &qtd_bebida);
  20.  
  21.     if (bebida == 1) {
  22.         total += (8 * qtd_bebida);
  23.         tempo += (5 * qtd_bebida);
  24.     } else if (bebida == 2) {
  25.         total += (12 * qtd_bebida);
  26.         tempo += (8 * qtd_bebida);
  27.     }
  28.  
  29.     printf("\nSelecione seu lanche\n");
  30.     printf("1 - Sanduíches integrais\t15,00\t8 min\n");
  31.     printf("2 - Misto quente\t\t15,00\t10 min\n");
  32.     printf("3 - Pastéis fritos\t\t16,00\t12 min\n");
  33.     printf("4 - Hamburguer\t\t\t20,00\t15 min\n");
  34.     printf("Opção: ");
  35.     scanf("%d", &lanche);
  36.    
  37.     printf("Quantidade de lanches: ");
  38.     scanf("%d", &qtd_lanche);
  39.  
  40.     if (lanche == 1) {
  41.         total += (15 * qtd_lanche);
  42.         tempo += (8 * qtd_lanche);
  43.     } else if (lanche == 2) {
  44.         total += (15 * qtd_lanche);
  45.         tempo += (10 * qtd_lanche);
  46.     } else if (lanche == 3) {
  47.         total += (16 * qtd_lanche);
  48.         tempo += (12 * qtd_lanche);
  49.     } else if (lanche == 4) {
  50.         total += (20 * qtd_lanche);
  51.         tempo += (50 * qtd_lanche);
  52.     }
  53.  
  54.     printf("\nValor Total a Ser Pago = %d\n", total);
  55.     printf("Tempo de Espera = %d\n", tempo);
  56.  
  57.     return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment