所以香港專業教育學院加粗了錯誤的發生,但我不明白爲什麼有發生它沒有任何意義,我變量錯誤,無法轉換爲布爾錯誤
for(int i = 1; i < Array.getLength(purchases);i++)
{
System.out.print("\n");
System.out.print("Enter a price for item #"+i+": $");
double temp3=input.nextDouble();
double price=temp3;
if(price=>0) **<==it wont let me have both = and >**
{
total=total+price;
double temp1=total*100;
int temp2=(int)temp1;
total=temp2/100.0;
System.out.print("That was $"+price+". Your total is $"+total);
}
else(price==0) **<=="The left-hand side of an assignment must be a variable"**
{
}
}
你得到什麼錯誤? –
你不能在代碼格式中使用粗體,現在代碼被格式化爲 –