Score Judgement
題目說明
判斷輸入成績屬於何成績等第
根據原程式碼,請在給F的那個區塊中,增加程式去判斷成績和passScore的差距是否小於等於5分,若是true,則輸出訊息I am sorry
。
請不要在程式中寫死55分,因為passScore可能會改變,例如,碩士班及格成績是70,此時就不能用55分決定是否輸出I am sorry
。
把成績 examScore 改成讓使用者自己輸入,並且判斷若使用者輸入的成績小於0或大於100,則告訴他輸入有錯,並用System.exit(0);
立即停止程式。
把及格門檻 passScore 也改成讓使用者自己輸入,並且判斷若使用者輸入的成績小於0或大於100,則告訴他輸入有錯,並用System.exit(0);
立即停止程式。
輸入限制: 數字
Input
先輸入examScore 再輸入passScore
Output
成績等第
Sample Input1
85
60
Sample Output1
B
Sample Input2
58
60
Sample Output2
I am sorry!
Sample Input3
100
-1
Sample Output3
wrong passScore!
Sample Input4
101
60
Sample Output4
wrong examScore!
Sample Input5
15
60
Sample Output5
F
Sample Input6
92
95
Sample Output6
I am sorry!
Comments
剛剛題目中的output大小寫有誤 請確認輸出內容如下格式:
wrong examScore!
wrong passScore!
I am sorry!