Skip to content
This repository was archived by the owner on Jan 24, 2020. It is now read-only.

Commit 818f033

Browse files
Added call and import for subtraction
1 parent 369adba commit 818f033

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Main.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import static Square.square
2+
import static Subtract.subtract
23
import static Sum.sum
34

45
def name = "Matthew"
@@ -7,4 +8,5 @@ int programmingPoints = 10
78
println "Hello ${name}"
89
println "${name} has at least ${programmingPoints} programming points."
910
println "${programmingPoints} squared is ${square(programmingPoints)}"
11+
println "${programmingPoints} minus 7 bonus points is ${subtract(programmingPoints, 7)}"
1012
println "${programmingPoints} plus 3 bonus points is ${sum(programmingPoints, 3)}"

src/Subtract.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
static int subtract(int val1, val2) {
2+
val1 - val2
3+
}

0 commit comments

Comments
 (0)