![]() |
Example 16Those earning over a certain amount have to pay income tax. To keep the figures simple we'll say that if you earn less than $5000 you pay no income tax, otherwise you pay 25% of anything over $5000. A person earning $4500 would therefore pay no tax but someone earning $5500 would pay 25% of $500, ie $125 in tax. See your teacher now if you're not sure how this works. We would like a program which asks the user to enter the amount earned and which then calculates the tax paid, if any, and prints out the results. 1. Design a Solution
2. Code the Program
|
© 1998 John Brewer |