回答編集履歴
2
少し修正
answer
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
static int discount( int totalTaxPrice ){
|
|
7
7
|
|
|
8
8
|
int discountNum = 0; //割引金額を一時保持
|
|
9
|
-
if(totalTaxPrice >
|
|
9
|
+
if(totalTaxPrice > 5000){} //discountNumに20%割引をした金額を挿入
|
|
10
|
-
else if(totalTaxPrice >
|
|
10
|
+
else if(totalTaxPrice > 1000){} //discountNumに10%割引をした金額を挿入
|
|
11
11
|
|
|
12
12
|
if (discountNum > 5000) //割引金額の上限は5000円
|
|
13
13
|
return discountNum;
|
1
少し修正
answer
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
if(totalTaxPrice >= 5000){} //discountNumに20%割引をした金額を挿入
|
|
10
10
|
else if(totalTaxPrice >= 1000){} //discountNumに10%割引をした金額を挿入
|
|
11
11
|
|
|
12
|
-
if (discountNum >
|
|
12
|
+
if (discountNum > 5000) //割引金額の上限は5000円
|
|
13
13
|
return discountNum;
|
|
14
14
|
}
|
|
15
15
|
|