if (annual <= lowincome && aChar == 'S')
owe = annual * .25;
else if (annual > lowincome || annual < medincome && aChar == 'S')
owe = annual * .50;
else if (annual > medincome && Char == 'S')
owe = annual * .75;
else if (aChar == 'M' && annual <= lowincome)
owe = annual *.24;
else if(annual > low income || annual < medincome && aChar == 'M')
owe = annual * .49;
else if(annual > medincome && Char == 'M')
owe = annual * .74;
我希望用戶輸入,如果他們是已婚還是單身然後去雖然計算髮現那裏每年income.I後得到這個錯誤我得到一個錯誤的最後3如果else語句
TaxReturn.java:54: error: ')' expect
if(annual > low income || annual < medincome && aChar == 'M')
^
TaxReturn.java:54: error: not a statement
if(annual > low income || annual < medincome && aChar == 'M')
^
TaxReturn.java:54: error: ';' expect
if(annual > low income || annual < medincome && aChar == 'M')
TaxReturn.java:56: error: 'else' without 'if'
else
^
TaxReturn.java:68: error: class, interface, or enum expected
}
^
5 errors
[標籤:家庭作業]? **這個標籤是OBSOLETE **。 –
爲什麼你不喜歡大括號?無論如何,這是你的完整代碼嗎? –
OMG太多if-else-if-else .. !!你的代碼中存在錯誤,我建議你逐個剖析,你將會知道你在哪裏做過錯誤:) –