Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <math.h>
  4.  
  5. int main(){
  6.  
  7.     double value;
  8.     float tax;
  9.  
  10.     printf("Ange taxeringsvärdet: ");
  11.     scanf_s("%f", &value);
  12.  
  13.     if(value <= 450000)
  14.         tax = value * 0.02;
  15.     else
  16.         if(value < 600000)
  17.             tax = (value - 450000) * 0.04 + 450000 * 0.02;
  18.         else
  19.             if(value < 750000)
  20.                 tax = (value - 600000) * 0.06 + 150000 * 0.04 + 450000 * 0.02;
  21.             else
  22.                 tax = (value - 750000) * 0.08 + 150000 * 0.06 + 150000 * 0.04 + 450000 * 0.02;
  23.  
  24.     printf("%d ger %f i skatt.", value, tax);
  25.    
  26.     getchar();
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement