The code is
class X
creation
make
feature
number: REAL
make is
-- set the initial value of number and then use it
do
set (43)
add3
add (6)
end -- make
set (value: REAL) is
-- set the value of number to value
do
number := this
end -- set
add3 is
-- add 3 to the number, display the new value
do
number := number + 3
io.putstring ("%NThe value of number is now ")
io.putreal (number)
end -- add3
add (increment: REAL) is
-- add increment to the number, display the new value
do
number := number + increment
io.putstring ("%NThe value of number is now ")
io.putreal (number)
end -- add
end -- class X