Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- note
- description : "Temperature application root class"
- class
- APPLICATION
- create
- make
- feature {NONE} -- Initialization
- first_temperature: TEMPERATURE
- second_temperature: TEMPERATURE
- make
- -- Run application.
- do
- io.put_string ("Enter the first temperature in Celsius: ")
- io.read_integer
- create first_temperature.make_celsius (io.last_integer)
- io.put_string ("The first temperature in Kelvin is: ")
- io.put_integer (first_temperature.kelvin)
- io.new_line
- io.put_string ("The first temperature in Fahrenheit is: ")
- io.put_integer (first_temperature.fahrenheit)
- io.new_line
- io.put_string ("Enter the second temperature in Kelvin: ")
- io.read_integer
- create second_temperature.make_kelvin (io.last_integer)
- io.put_string ("The second temperature in Celsius is: ")
- io.put_integer (second_temperature.celsius)
- io.new_line
- io.put_string ("The second temperature in Fahrenheit is: ")
- io.put_integer (second_temperature.fahrenheit)
- io.new_line
- io.put_string ("The average temperature in Celsius is: ")
- io.put_integer (second_temperature.average (first_temperature).celsius)
- io.put_string ("%NThe average temperature in Kelvin is: ")
- io.put_integer (second_temperature.kelvin)
- io.put_string ("%NThe average temperature in Fahrenheit is: ")
- io.put_integer (second_temperature.fahrenheit)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement