Advertisement
PhilDrummer

Assignment_10 02 APPLICATION.e

Dec 16th, 2014
1,233
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class
  2.     APPLICATION
  3.  
  4. create
  5.     make
  6.  
  7. feature {NONE} -- Initialization
  8.     make
  9.             -- Run application.
  10.         local
  11.             sensor: TEMPERATURE_SENSOR
  12.             display: DISPLAY
  13.             controller: HEATING_CONTROLLER
  14.         do
  15.             create sensor.make
  16.             create display
  17.             create controller.set_goal (20)
  18.             sensor.register (agent display.show)
  19.             sensor.register (agent controller.adjust)
  20.  
  21.             -- Hardware simulation:
  22.  
  23.             sensor.set_temperature (0)
  24.             sensor.set_temperature (10)
  25.             sensor.set_temperature (20)
  26.             sensor.set_temperature (30)
  27.             sensor.set_temperature (25)
  28.             sensor.set_temperature (20)
  29.             sensor.set_temperature (20)
  30.             sensor.set_temperature (-20)
  31.             sensor.set_temperature (-10)
  32.             sensor.set_temperature (0)
  33.             sensor.set_temperature (15)
  34.             sensor.set_temperature (18)
  35.             sensor.set_temperature (20)
  36.         end
  37. end
Advertisement
RAW Paste Data Copied
Advertisement