123456789101112131415161718192021222324252627282930313233343536373839 |
-
- /**
- * Write a description of class Memory here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class Memory
- {
- private static double mem;
-
- public Memory()
- {
- // initialise instance variables
- mem = 0;
- }
-
- public static double memRead()
- {
- return mem;
- }
-
- public static double memUpdate(double lastAns)
- {
- return mem = lastAns;
-
-
- }
-
- public static double memClear()
- {
- return mem = 0;
- }
-
- public static void printAns(String printAnswer){
- System.out.println(printAnswer);
- }
- }
|