⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 teamscores.java

📁 PracticalJAVACode 的源码
💻 JAVA
字号:
abstract class TeamScores
{
  private Team team;

  public abstract int player1Score(int holeNumber, Team team);
  public abstract int player2Score(int holeNumber, Team team);
  public abstract void storeTeamScore(int score, Team team);
  public void processBetterBallTeamScores(Team team)
  {
    int teamScore = 0;
    for (int i=1; i<=18; i++)  //Compute team scores for each hole
    {
      int p1Score = player1Score(i, team);
      int p2Score = player2Score(i, team);
      if (p1Score < p2Score)
        teamScore = p1Score;
      else
        teamScore = p2Score;
      storeTeamScore(teamScore, team);
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -