Vincent Sima 6 anos atrás
pai
commit
d3009c6a37
3 arquivos alterados com 8 adições e 6 exclusões
  1. 1
    2
      CoreFunctions.java
  2. 6
    3
      MainApplication.java
  3. 1
    1
      ScientificFunctions.java

+ 1
- 2
CoreFunctions.java Ver arquivo

@@ -1,8 +1,7 @@
1 1
 
2 2
 public class CoreFunctions 
3 3
 {
4
-    double display = 0;
5
-    double memory = 0;
4
+
6 5
     public static boolean decMode = true;
7 6
     public static boolean hexMode = false;
8 7
     public static boolean binMode = false;

+ 6
- 3
MainApplication.java Ver arquivo

@@ -80,13 +80,16 @@ public class MainApplication  {
80 80
                     display = (double)Math.acos(display);
81 81
                 }
82 82
                 if(operator.equalsIgnoreCase("M+")){
83
-                    ScientificFunctions.setMem(display);
83
+                    System.out.println("Memory Added");
84
+                    ScientificFunctions.memory=display; 
84 85
                 }
85 86
                 if(operator.equalsIgnoreCase("MC")){
86
-                    ScientificFunctions.resetMem();
87
+                    System.out.println("Memory Cleared");
88
+                    ScientificFunctions.memory=0; 
87 89
                 }
88 90
                 if(operator.equalsIgnoreCase("MRC")){
89
-                    ScientificFunctions.recallMem();
91
+                    System.out.println("Memory Recalled!");
92
+                    display = ScientificFunctions.memory; 
90 93
                 }
91 94
                 if(operator.equalsIgnoreCase("clear")){
92 95
                     System.out.print('\u000C');

+ 1
- 1
ScientificFunctions.java Ver arquivo

@@ -50,7 +50,7 @@ public class ScientificFunctions
50 50
     }
51 51
 
52 52
     public static double recallMem() {
53
-        System.out.println("Memory Reset!");
53
+        System.out.println("Memory Recalled!");
54 54
         return display = memory; 
55 55
 
56 56
     }