你们这些人可以帮我解决这个项目吗?我正在尝试编译它,但无法弄清楚它发生了什么。有两个java文件,我将发送主要的文件,这是有问题的(直到现在)。这是一个计算公司每月利润的简单程序。
import java.util.Scanner;
public class MonthExe{
public static void main( String[] args ){
Scanner input = new Scanner( System.in );
System.out.println( "Inform the current year..." );
public int curYear = input.nextInt();
public int catNum;
String control = "n";
while ( control = "n" ){
System.out.println( "Inform the current month..." );
int curMonth = input.nextInt();
Month month = new Month( curMonth );
month.monthMessage( curMonth );
String control = input.next();
}
System.out.println( "Inform the number of arts..." );
curArts = input.nextInt();
System.out.println( "Inform the number of categories from the cheapest to the most expensive one..." );
catNum = input.nextInt();
curVals = new double[ catNum ];
for ( int i = 0; int = catNum; i++ ){
System.out.println( "Inform the price of the category" + ( i + 1 ) );
curVals[i] = input.nextDouble();
}
Month month = new Month( curYear, curArts, curVals );
for ( int j = 1; int = curArts; j++ ){
for ( int k = 1; int = curVals.length; k++ ){
System.out.println( "Inform the amount of units sold for product " + j + " and category " + k );
int curAmount = input.nextInt();
month.setProfit( curAmount, k );
month.setTotalProfit( month.getTotalProfit() );
}
}
month.finalMessage();
System.out.println( "Thank you for using this software!" );
}
}
尝试编译上面的程序会给我带来这5个错误...有人可以解释它们的含义吗?提前谢谢!
MonthExe.java:7:错误:非法开始表达 public int curYear = input.nextInt();
MonthExe.java:8:错误:非法开始表达 public int catNum;
MonthExe.java:22:错误:'。class'预期 for(int i = 0; int< catNum; i ++){
MonthExe.java:27:错误:'。class'预期 for(int j = 1; int< = curArts; j ++){
MonthExe.java:28:错误:'。class'预期 for(int k = 1; int< = curVals.length; k ++){