nikolas_serafini

Lista 2 - Exercício 34

May 27th, 2013
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     float water,subtotal,price;
  7.  
  8.     printf("Entre com o consumo de agua (em m^2) de sua casa :\n"); scanf("%f",&water);
  9.  
  10.     if ((water>=0)&&(water<=10)) subtotal = water*0.69;
  11.     else if ((water>10)&&(water<=15)) subtotal = water*1.17;
  12.     else if ((water>15)&&(water<=25)) subtotal = water*1.48;
  13.     else subtotal = water*1.6;
  14.  
  15.     price = subtotal + (subtotal*0.025) + 5;
  16.  
  17.     printf("O valor da conta de agua eh : %f\n",price);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment