这是显示分数菜单的代码块:
public void scoreBoard() //the score board to keep count; need to display 4 times
{
Scanner score = new Scanner (System.in);
for (int k = 1; k <= 4; k++) //repeat for the 4 quarters
{
System.out.println( "T : " );
System.out.println( touchdown * score.nextInt()); //scores of the plays made
System.out.println("F : ");
System.out.println(fieldgoal * score.nextInt());
System.out.println("E : ");
System.out.println ( extrapnt * score.nextInt());
System.out.println ("P : ");
System.out.println ( twopntcon * score.nextInt());
System.out.println("S : " );
System.out.println( safety * score.nextInt());
System.out.println ( "Q : Done with quarter " + k);
}
}
我似乎无法弄清楚如何使用这些值并计算总分。请帮忙。