program ex14;
const basic_tax_rate=23;
higher_rate_tax=40;
tax_threshold=5000;
higher_tax_threshold=30000;
var income, standard_tax, higher_tax, total_tax, net_income: real;
begin
total_tax:=0;
standard_tax := 0;
higher_tax := 0;
writeln ('Enter a value for income');
readln (income);
if (income < tax_threshold) then total_tax:=0;
if (income > tax_threshold) and (income < higher_tax_threshold)
then
begin
standard_tax::= (income - tax_threshold) * ;
total_tax := standard_tax
end;;
if (income > higher_tax_threshold) then
begin
standard_tax := (higher_tax_threshold - tax_threshold)
* basic_tax_rate / 100;
higher_tax := (income - higher_tax_threshold) *
higher_rate_tax / 100;
total_tax := standard_tax + higher_tax;
end
net_income:= income - total_tax;
writeln ('Income after tax is: £', net_income: 8:2);
readln;
end.
The question defines three zones of income for tax: a zone up to £5,000 with no tax, a zone from £5,001 to £30,000 at standard rate and a zone above £30,000 at higher rate. The if statements identify the level of income and calculate tax on the different zones f income. Using constants makes it easy to update the program because nothing else needs to change.