tdd-java-demo
tdd java demo with micro-commits
git clone https://9o.is/git/tdd-java-demo.git
commit bbcb174202cff64f5b24376e5c53682a7c982a19 parent 835ec05483c51a030b187620011a03d22a10f828 Author: Jul <jul@9o.is> Date: Wed, 31 Mar 2021 15:45:10 +0800 introduce variable amount for input Diffstat:
| M | src/main/java/takehome/Runner.java | | | 3 | ++- |
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/takehome/Runner.java b/src/main/java/takehome/Runner.java @@ -19,7 +19,8 @@ public class Runner { String name = "soup"; double cost = 0.65; out.println("How much " + name + "?"); - double total = in.nextInt() * cost; + int amount = in.nextInt(); + double total = amount * cost; DecimalFormat df = new DecimalFormat("0.00"); out.println("Total: $" + df.format(total));