Miniature Golf Requirements Specification
Description
You are to design and create a program called MiniatureGolf. The MiniatureGolf Program is supposed to simulate a group of golf players playing a game of golf. There should be user input to determine the number of players, and also the number of holes to be played.
Group.java
Group is a provided class that hides the detail of containing an arbitrary number of Player objects. The Group class has two public methods, nextPlayer and morePlayersLeft, which can be used in iterate through the player objects, one at a time.
Course.java
Course is a provided class that will contain a Group object. There are two public methods in Course, one for adding Players to the Group, and one that returns the Group object.
Player.java
You must write a Player class which adheres to the corresponding Player documentation. It will have a public method called putt which will generate a random number. If that number is above a certain threshold, then the Player makes the hole. From then on, the putt method does nothing until another method calles newHole is called. Then the process starts over again. (The threshold value does not have to be a user-input value. In fact, a probability of .465 of making the shot is generally good.)
MiniatureGolf.java
You must write the MiniatureGolf class, the main class, of the program. MiniatureGolf is responsible for prompting the user for the number of players and also the number of holes to play. These numbers should "make sense". That is, a negative value, or a very very high value probably isn't a good idea. After taking in the numbers, the program should proceed, for every hole, to take turns through the players until they all have hit their ball in the hole.
You don't have to worry about output, but it would be nice just to see what your program is doing when it executes. This is designed to be a relatively simple and straightforward example using control statements and classes that have collections of an arbitrary number of objects.
Documentation
Group
Course
Player
MiniatureGolf