rmword

Untitled

Sep 28th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. /**
  2. * Write a description of class Heater here.
  3. *
  4. * @author Rifqi Mukti W
  5. * @version 29.09.2017
  6. */
  7. public class Heater
  8. {
  9. // instance variables - replace the example below with your own
  10. private double temperature;
  11.  
  12. public Heater()
  13. {
  14. // initialise instance variables
  15. temperature = 15.0;
  16. }
  17.  
  18. public void warmer()
  19. {
  20. temperature = temperature + 5.0;
  21. }
  22.  
  23. public void cooler()
  24. {
  25. temperature = temperature - 5.0;
  26. }
  27.  
  28. public double getTemperature()
  29. {
  30. return temperature;
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment