Я не могу понять, как реализовать publi c String getMVP () {}. как бы я это сделал? - PullRequest
0 голосов
/ 20 марта 2020

Я не могу понять, как реализовать publi c String getMVP () {}. как бы я это сделал?

public class Player{

private String name;

private double battingAverage;

private boolean mostValuablePlayer; true if this player has been selected as the teams MVP this year, otherwise false

// other attributes

//constructors and other methods



public String getName() { return name; }

public double getBattingAverage { return battingAverage; }

public boolean isMVP(){return mostValuablePlayer;}

}



public class BaseballTeam{

private ArrayList players;

// more attributes

// constructor and other methods

/**

returns the name of the player selected as the most valuable player on this team  @return String name of the Most Valuable Player 
/*

public String getMVP(){

// Implement this method with a while loop that will terminate when the MVP has been found

}

}
...