Browse Source

add, subtract, multiply and divide functions added

Michelle DiMarino 6 years ago
parent
commit
49a7631aab

+ 4
- 4
src/main/java/rocks/zipcode/calcskin/CalcEngine.java View File

6
     }
6
     }
7
 
7
 
8
     public double add(double v, double v1) {
8
     public double add(double v, double v1) {
9
-        return Double.NaN;
9
+        return v+v1;
10
     }
10
     }
11
 
11
 
12
     public double subtract(double v, double v1) {
12
     public double subtract(double v, double v1) {
13
-        return Double.NaN;
13
+        return v-v1;
14
     }
14
     }
15
 
15
 
16
     public double multiply(double v, double v1) {
16
     public double multiply(double v, double v1) {
17
-        return Double.NaN;
17
+        return v * v1;
18
     }
18
     }
19
 
19
 
20
     public double divide(double v, double v1) {
20
     public double divide(double v, double v1) {
21
-        return Double.NaN;
21
+        return v/v1;
22
     }
22
     }
23
 }
23
 }

+ 1
- 1
src/main/java/rocks/zipcode/calcskin/CalcSkin.java View File

50
         final TextField screen  = createScreen();
50
         final TextField screen  = createScreen();
51
         final TilePane  buttons = createButtons();
51
         final TilePane  buttons = createButtons();
52
 
52
 
53
-        stage.setTitle("Calc");
53
+        stage.setTitle("Michelle's Calculator");
54
         stage.initStyle(StageStyle.UTILITY);
54
         stage.initStyle(StageStyle.UTILITY);
55
         stage.setResizable(false);
55
         stage.setResizable(false);
56
         stage.setScene(new Scene(createLayout(screen, buttons)));
56
         stage.setScene(new Scene(createLayout(screen, buttons)));