好的,这是我在这里的第一篇文章。(善待我 :)) 我就像 Java 两周大,想创建一个应用程序,可以完成总分、平均分和平均分的工作。我的问题是。一个操作结束后如何返回到特定的代码行 例如:我希望代码运行String menu1="Input the number of the operation you want"; 在找到总数或平均值之后。提前致谢
import java.util.Scanner;
public class grader
{
public static void main (String args[])
{
Scanner input=new Scanner(System.in);
System.out.println ("Input your Chemistry marks");
float a= input.nextFloat();
System.out.println ("Input your Biology marks");
float b= input.nextFloat();
System.out.println ("Input your Physics marks");
float c= input.nextFloat();
String menu1="Input the number of the operation you desire ";
String op1="1. Total ";
String op2="2. Average ";
String op3="3. Grade ";
String op4="4. Exit …Run Code Online (Sandbox Code Playgroud)