Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Tax
- float tax = 0;
- float taxStore = 0;
- float taxStore2 = 0;
- float taxStore3 = 0;
- float taxStore4 = 0;
- //Taxes
- void taxes(void);
- void firstBracket(void);
- void secondBracket(void);
- void thirdBracket(void);
- void fourthBracket(void);
- void taxes(void){
- //taxed at the fourth turn
- taxStore = balance;
- taxStore2 = 0;
- taxStore3 = 0;
- taxStore4 = 0;
- if(balance <= 9000){
- taxStore *= 0;
- }
- else if (balance > 9000){ // 1 000 000
- if (balance >= 9001 && balance <= 13996){
- taxStore2 = taxStore;
- taxStore2 = taxStore2 - 9000;
- taxStore3 = taxStore2 * 0.15;
- taxStore2 = taxStore2 - taxStore3;
- }
- else if (balance >= 13997 && balance <= 54949){
- taxStore2 = taxStore;
- taxStore2 = taxStore2 - 13996;
- taxStore3 = taxStore2 * 0.2397;
- taxStore4 = taxStore2 - taxStore3;
- taxStore2 = taxStore3;
- firstBracket();
- }
- else if (balance >= 54950 && balance <= 260532){
- taxStore2 = taxStore;
- taxStore2 = taxStore2 - 54949;
- taxStore3 = taxStore2 * 0.42;
- taxStore4 = taxStore2 - taxStore3;
- taxStore2 = taxStore3;
- secondBracket();
- firstBracket();
- }
- else if (balance >= 260533){
- taxStore2 = taxStore;
- taxStore2 = taxStore2 - 260532;
- taxStore3 = taxStore2 * 0.45;
- taxStore4 = taxStore2 - taxStore3;
- taxStore2 = taxStore3;
- thirdBracket();
- secondBracket();
- firstBracket();
- }
- }
- }
- void firstBracket(void){
- float taxStore5 = 0;
- taxStore5 += (13996 * 0.15);
- taxStore2 = taxStore2 + taxStore5;
- }
- void secondBracket(void){
- float taxStore5 = 0;
- taxStore5 += (54949 * 0.2397);
- taxStore2 = taxStore2 + taxStore5;
- }
- void thirdBracket(void){
- float taxStore5 = 0;
- taxStore5 += (260532 * 0.42);
- taxStore2 = taxStore2 + taxStore5;
- }
- void fourthBracket(void){
- float taxStore5 = 0;
- taxStore5 += (balance * 0.45);
- taxStore2 = taxStore2 + taxStore5;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement