我有一個for循環,我試圖讓它增加5000年的銷售量,並打印計算10次,增加了佣金,但我不盡人意。 (這當然是在原始計算之後)爲什麼我的代碼不足?也是在我的第一個輸出後,我不能讓剩下的代碼運行。試圖添加一個循環
System.out.println("Enter your annual sales");
String annual = input.nextLine();
int salary = 7550281;
int commission = 38_28;
if (Integer.parseInt(annual) < 92416_02) {
commission = 37_28 * 1_32/100;
}
int compensation = Integer.parseInt(annual) * commission/100 + salary;
System.out.println("compensation is: "+compensation);
for(int sales = (Integer.parseInt(annual)); sales < 10; sales +=5000);
int salary = 7550281;
int commission = 38_28;
if (Integer.parseInt(annual) < 92416_02) {
commission = 37_28 * 1_32/100;
}
int compensation = Integer.parseInt(annual) * commission/100 + salary;
System.out.println("Your Annual compensation in 5000 increments are ");
所有的下劃線應該是小數點。 –
for(int sales =(Integer.parseInt(annual)); sales <10; sales + = 5000);爲什麼在你之後有一個分號?我想你的意思是在for循環中有一段代碼? – Taylor
這也許是他的錯誤。 –