tdd-java-demo
tdd java demo with micro-commits
git clone https://9o.is/git/tdd-java-demo.git
commit 835ec05483c51a030b187620011a03d22a10f828 parent b61007db05cac51f7a19939d1c19fe7ca168bdd8 Author: Jul <jul@9o.is> Date: Wed, 31 Mar 2021 15:44:36 +0800 introduce variable cost for item 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 @@ -17,8 +17,9 @@ public class Runner { public void run() { String name = "soup"; + double cost = 0.65; out.println("How much " + name + "?"); - double total = in.nextInt() * 0.65; + double total = in.nextInt() * cost; DecimalFormat df = new DecimalFormat("0.00"); out.println("Total: $" + df.format(total));