rendered paste bodyfloat tax() { float taxToPay; int basicTax = 20; int higherTax = 40; int additionalTax = 50; float basic, higher, additional; bool additionalCheck, higherCheck; if (moneyEach() > higherTaxThreshold) { additional = ((moneyEach() - higherTaxThreshold) / 100) * additionalTax; additionalCheck = true; } else { additional = 0; additionalCheck = false; } if (additionalCheck == true && moneyEach() > basicTaxThreshold) { higher = ((higherTaxThreshold - basicTaxThreshold) / 100) * higherTax; higherCheck = true; } else if (moneyEach() > basicTaxThreshold) { higher = ((moneyEach() - basicTaxThreshold) / 100) * higherTax; higherCheck = true; } else { higher = 0; higherCheck = false; } if (higherCheck == true) { basic = (basicTaxThreshold / 100) * basicTax; } else { basic = (moneyEach() / 100) * basicTax; } taxToPay = basic + higher + additional; return (taxToPay);}