我有我为一门课程创建的这个 java 代码。我已经尝试并继续失败执行中断语句。
有人可以指出我正确的方向吗?
import java.util.Scanner;
public class gradeAverage {
public static void main( String[] args ){
Scanner input = new Scanner(System.in);
int input1;
int input2;
int input3;
//Calculate
int studentAvg;
//Prompt for first user input or break if input = q
System.out.print( "Enter first student grade or q to quit: ");
if {
(input1=input.nextInt() = q)
break;
else
input1=input.nextInt() =;
}
//Prompt for second user input or break if input = q
System.out.print( "Enter second student grade or q to quit: ");
input2=input.nextInt();
//Prompt for third user input or break if input = q
System.out.print( "Enter third student grade or q to quit: ");
input3=input.nextInt();
studentAvg=(input1+input2+input3)/3;
System.out.printf( "The Student's grade average is %d\n" , studentAvg);
}
}