previous page main index next page
 

Example 16

Those 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

  • as before, design a suitable solution
  • show the completed design to your teacher

2. Code the Program

  • type in the code for your program
  • save it as taxes.pas
  • compile and run the program
     
previous page main index next page
 
©2001