Question2です

This commit is contained in:
2026-09-11 16:19:51 +09:00
parent 81d17fd20a
commit 85a626ef91
11 changed files with 48 additions and 14 deletions

View File

@@ -17,7 +17,10 @@ public class PTra02_08 {
// TODO 買い物した際の残金計算をします。
// TODO 所持金から価格を引いた値を、買い物後の所持金として再代入してください。
// ※消費税を考慮してください。税込み商品価格の端数は切り捨てとします。
double price2 = price*1.08;
int price3 = (int)price2;
money = (money - price3);
// 残金の表示部分です。編集しないでください
System.out.println("残金は" + money + "円です。");