Jvsierra

Ex proposto 10

Feb 12th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.84 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main(){
  6.  
  7.     float custo_total = 0.0, custo_fabrica = 0.0, porc_distribuidor = 0.0, porc_impostos = 0.0;
  8.  
  9.     printf("Digite o custo de fabrica:\n");
  10.     scanf("%f", &custo_fabrica);
  11.  
  12.     if(custo_fabrica <= 12000){
  13.         porc_distribuidor = 0.05 * custo_fabrica;
  14.     }else if(custo_fabrica > 12000 && custo_fabrica <= 25000){
  15.         porc_distribuidor = 0.1 * custo_fabrica;
  16.         porc_impostos = 0.15 * custo_fabrica;
  17.     }else{
  18.         porc_distribuidor = 0.15 * custo_fabrica;
  19.         porc_impostos = 0.2 * custo_fabrica;
  20.     }
  21.  
  22.     custo_total = custo_fabrica + porc_distribuidor + porc_impostos;
  23.  
  24.     printf("Custo de fabrica:%.2f\nComissao do distribuidor: %.2f\nImpostos: %.2f\nCusto total: %.2f\n", custo_fabrica, porc_distribuidor, porc_impostos, custo_total);
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment