Пример #1
0
 /// <summary>
 /// Displays the info.
 /// </summary>
 /// <param name="player">Player.</param>
 /// <param name="playerIndex">Player index.</param>
 public void DisplayInfo(BaseBallPlayer player, int playerIndex)
 {
     string prefix = "[Player] " + playerIndex + "] ";
     Console.WriteLine();
     Console.WriteLine(prefix + " BattingAvg: " + player.BattingAvg);
     Console.WriteLine(prefix + " Name: " + player.FirstName + " " + player.LastName);
     Console.WriteLine(prefix + " Team: " + player.Team);
 }
Пример #2
0
        private void addPlayer()
        {
            Console.WriteLine("Player " + players.Count + ":\n");
            BaseBallPlayer player = new BaseBallPlayer();
            player.FirstName = promptForString("First Name: ");
            player.LastName = promptForString("Last Name: ");
            player.Team = promptForString("Team: ");
            player.BattingAvg = promptForDouble("Batting Average: ");

            players.Add(player);
        }