12345678910111213141516171819202122232425262728293031323334353637 |
-
- /**
- * 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);
- }
- }
|