Advertisement
G4BR13L_

Teste07E01

Jun 24th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.82 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <locale.h>
  4.  
  5. int main(void)
  6. {
  7.  
  8.     setlocale("LC_All", "portuguese");
  9.  
  10.     float exemptionQuota = 1500.00, tax = 0.5, productValue;
  11.  
  12.     printf("\nInforme o valor do produto: ");
  13.     scanf("%f", &productValue);
  14.  
  15.     if (productValue > exemptionQuota)
  16.     {
  17.         float diferenceFromQuota = productValue - exemptionQuota, taxedValue = diferenceFromQuota + (diferenceFromQuota * tax);
  18.         printf("\n O produto de valor %f excedeu a cota de %f, com a diferença de preço em: %f, sendo taxado no valor de: %f\n", productValue, exemptionQuota, diferenceFromQuota, taxedValue);
  19.     }
  20.     else
  21.     {
  22.         printf("\n O produto de valor %f não excedeu a cota de %f, portanto não será taxado.\n", productValue, exemptionQuota);
  23.     }
  24.    
  25.    
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement