Advertisement
Cnvmendoza

Tax test

Nov 18th, 2021
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.86 KB | None | 0 0
  1.  
  2. //Tax
  3. float tax = 0;
  4. float taxStore = 0;
  5. float taxStore2 = 0;
  6. float taxStore3 = 0;
  7. float taxStore4 = 0;
  8.  
  9. //Taxes
  10. void taxes(void);
  11. void firstBracket(void);
  12. void secondBracket(void);
  13. void thirdBracket(void);
  14. void fourthBracket(void);
  15.  
  16. void taxes(void){
  17.     //taxed at the fourth turn
  18.     taxStore = balance;
  19.     taxStore2 = 0;
  20.     taxStore3 = 0;
  21.     taxStore4 = 0;
  22.     if(balance <= 9000){
  23.         taxStore *= 0;
  24.     }
  25.     else if (balance > 9000){ // 1 000 000
  26.         if (balance >= 9001 && balance <= 13996){
  27.             taxStore2 = taxStore;
  28.             taxStore2 = taxStore2 - 9000;
  29.             taxStore3 = taxStore2 * 0.15;
  30.             taxStore2 = taxStore2 - taxStore3;
  31.         }
  32.         else if (balance >= 13997 && balance <= 54949){
  33.             taxStore2 = taxStore;
  34.             taxStore2 = taxStore2 - 13996;
  35.             taxStore3 = taxStore2 * 0.2397;
  36.             taxStore4 = taxStore2 - taxStore3;
  37.             taxStore2 = taxStore3;
  38.             firstBracket();
  39.         }
  40.         else if (balance >= 54950 && balance <= 260532){
  41.             taxStore2 = taxStore;
  42.             taxStore2 = taxStore2 - 54949;
  43.             taxStore3 = taxStore2 * 0.42;
  44.             taxStore4 = taxStore2 - taxStore3;
  45.             taxStore2 = taxStore3;
  46.             secondBracket();
  47.             firstBracket();
  48.         }
  49.         else if (balance >= 260533){
  50.             taxStore2 = taxStore;
  51.             taxStore2 = taxStore2 - 260532;
  52.             taxStore3 = taxStore2 * 0.45;
  53.             taxStore4 = taxStore2 - taxStore3;
  54.             taxStore2 = taxStore3;
  55.             thirdBracket();
  56.             secondBracket();
  57.             firstBracket();
  58.         }
  59.     }
  60. }
  61.  
  62. void firstBracket(void){
  63.     float taxStore5 = 0;
  64.     taxStore5 += (13996 * 0.15);
  65.     taxStore2 = taxStore2 + taxStore5;
  66. }
  67.  
  68. void secondBracket(void){
  69.     float taxStore5 = 0;
  70.     taxStore5 += (54949 * 0.2397);
  71.     taxStore2 = taxStore2 + taxStore5;
  72. }
  73.  
  74. void thirdBracket(void){
  75.     float taxStore5 = 0;
  76.     taxStore5 += (260532 * 0.42);
  77.     taxStore2 = taxStore2 + taxStore5;
  78. }
  79.  
  80. void fourthBracket(void){
  81.     float taxStore5 = 0;
  82.     taxStore5 += (balance * 0.45);
  83.     taxStore2 = taxStore2 + taxStore5;
  84. }
  85.  
  86.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement