
class X
creation
make
feature
hours, pay_rate, tax_rate: REAL
gross, tax, net: REAL
make is
-- read in the hours worked, the pay rate and the tax rate
-- show the gross and net salary
do
io.putstring ("Pay per hour: ")
io.readreal
pay_rate := io.lastreal
io.putstring ("Tax rate: ")
io.readreal
tax_rate := io.lastreal
gross := hours * pay_rate
tax := gross * (tax_rate / 100)
net := gross - tax
io.putstring ("%NThe gross salary is $ ")
io.putreal (gross)
io.putstring ("%NThe net salary is $")
io.putreal (net)