All pastes #1892889 Raw Edit

Unnamed

public cpp v1 · immutable
#1892889 ·published 2010-07-01 16:39 UTC
rendered paste body
float 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);}