Practice: Classes

Take out a piece of paper. We’ll be programming on paper.

Problem 1

Create a Player class that has two instance variables:

The instance variables must be private. This means you need accessor methods. The Player’s name should be read-only. You can’t change their name after the Player instance is created.

Problem 2

Write a subroutine that asks the user how many players to create. The subroutine should create an array of Players of the right size then ask the user for the player’s names and create the PLayer instances.

Show me your code before you leave