Display.java 928B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Write a description of class Display here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class Display
  8. {
  9. private String displayValue;
  10. public String getDisplay() {
  11. return displayValue;
  12. }
  13. public void setDisplay(String prompt) {
  14. displayValue = prompt;
  15. }
  16. public void resetDisplay(String prompt) {
  17. displayValue = "0";
  18. }
  19. public void errorDisplay() {
  20. int Error = 1;
  21. while (Error == 1){
  22. String command = Console.getStringInput("ERROR. Please clear the display");
  23. if (command.equalsIgnoreCase("c") || command.equalsIgnoreCase("clear")) {
  24. Error = 0;
  25. setDisplay("0");
  26. Console.println(getDisplay());
  27. String resetValue = Console.getStringInput("Enter number");
  28. setDisplay(resetValue);
  29. }
  30. }
  31. }
  32. }