Memory.java 473B

12345678910111213141516171819202122232425
  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. private String memoryValue;
  10. public String recallMemory() {
  11. return memoryValue;
  12. }
  13. public void addMemory(String prompt) {
  14. memoryValue = Double.toString(Double.parseDouble(memoryValue) + Double.parseDouble(prompt));
  15. }
  16. public void resetMemory() {
  17. memoryValue = "0";
  18. }
  19. }