|
@@ -28,12 +28,12 @@ public class MemoryFunc {
|
28
|
28
|
|
29
|
29
|
while (!memoryOpt.equals("4")) {
|
30
|
30
|
|
31
|
|
- memoryOpt = Console.getStringInput("Select option by typing the key. (ie 1 for M+)").toLowerCase();
|
|
31
|
+ memoryOpt = Console.getStringInput("Select option by typing the key. (ie 1 for M+)");
|
32
|
32
|
|
33
|
33
|
if (memoryOpt.equals("1")) {
|
34
|
34
|
|
35
|
35
|
Double newMemory = Console.getDoubleInput("Enter the value to store");
|
36
|
|
- updateMemory(newMemory);
|
|
36
|
+ this.memory = updateMemory(newMemory);
|
37
|
37
|
break;
|
38
|
38
|
|
39
|
39
|
} else if (memoryOpt.equals("2")) {
|
|
@@ -54,16 +54,16 @@ public class MemoryFunc {
|
54
|
54
|
}
|
55
|
55
|
}
|
56
|
56
|
|
57
|
|
- public void updateMemory(Double memoryInput) {
|
58
|
|
- this.memory = memoryInput;
|
|
57
|
+ public Double updateMemory(Double memoryInput) {
|
|
58
|
+ return this.memory = memoryInput;
|
59
|
59
|
}
|
60
|
60
|
|
61
|
|
- public void clearMemory() {
|
62
|
|
- this.memory = DEFAULT_MEMORY_VALUE;
|
|
61
|
+ public Double clearMemory() {
|
|
62
|
+ return this.memory = DEFAULT_MEMORY_VALUE;
|
63
|
63
|
}
|
64
|
64
|
|
65
|
|
- public void displayMemory() {
|
66
|
|
- Console.println(memory.toString());
|
|
65
|
+ public Double displayMemory() {
|
|
66
|
+ return this.memory;
|
67
|
67
|
}
|
68
|
68
|
|
69
|
69
|
}
|