Memory.java 837B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * Write a description of class Memory here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class Memory
  8. {
  9. // instance variables - replace the example below with your own
  10. public double status, memory;
  11. public void status (double status)
  12. {
  13. // initialise instance variables
  14. this.status = status;
  15. }
  16. /**
  17. * Constructor for objects of class Memory
  18. */
  19. public void display(){
  20. System.out.println("Current Memory is, " + status);
  21. }
  22. public void M()
  23. {
  24. status = 0.0;
  25. this.status = status;
  26. display();
  27. }
  28. public void MRC(double current)
  29. {
  30. this.status = status += current;
  31. display();
  32. }
  33. public double recall()
  34. {
  35. return this.status;
  36. }
  37. }