Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int taxes(int wages, int tax_threshold, int supertax_threshold, float tax_rate, float supertax_rate) {
- int paystax, pays_supertax;
- int tax, int supertax;
- if (wages > tax_threshold) {
- paystax = true;
- tax = (wages - tax_threshold) * tax_rate;
- if (wages > supertax_threshold) {
- pays_supertax := true;
- supertax = (wages - supertax_threshold) * supertax_rate;
- }
- else {
- pays_supertax = false;
- supertax = 0;
- }
- }
- else {
- paystax = false;
- pays_supertax = false;
- tax = 0;
- supertax = 0;
- }
- return wages - tax - supertax;
- }
Advertisement
Add Comment
Please, Sign In to add comment