1. There are many ways to design a solution to this problem, but you are graded on meeting the specific specifications as given.
2. The game will only have one player play at a time.
3. Use proper statement indentation and meaningful variable names in the code.
4. Place a multi-line Javadoc block comment (not multiple single line comments) giving a description of what this application does before the class header.
5. Output spacing, formatting, and spelling are to match the example console output illustrated above, but of course the user input will be different.
6. Create and use the content of an interface with two constants named PREMIUM and BASIC. Set the value of PREMIUM to "P" and the value of BASIC to B. Include an abstract method called returnPlayer that has a Player parameter and returns a String value.
7. Create a superclass named Player that implements the interface. It has only four instance variables. One is for the player's name, one for the amount of money the player has, one for the players wager, and one for the players guess. Create getter and setter methods for all the instance variables. Implement the returnPlayer method so it returns all the Player object's data values with the type formatted with the first letter in uppercase and the remaining letters in lowercase.
8. Create two Player constructors. One will have no parameters and one will have the name and the amount of money parameters.
9. Create two subclasses of the Player class. One will be for the premium player and one for the basic player. Each has an instance variable that you need to determine from the specifications given below. Create necessary constructors and methods.
10. You mustuse this superclass and its subclasses in the application to create appropriate objects.
11. The premium player will have an automatic line of credit of $10.00. If a premium player loses all the money on the table, they will automatically be given $10.00 to continue playing.
12. The basic player has an enforced betting limit of $1 even if they have more than $1 on the table.
13. Add and use the Console class from chapter 7 or a modified version to validate user input data.
14. Create three packages to hold the five classes in the application and the one interface. One package will contain the super class and the two subclasses, one package will contain the interface and the console class, the third package will contain the class with the main method and the nine other methods described below. Give the packages appropriately descriptive names.
15. Prompt the user for data and store this data appropriately.
16. Validate the data so only acceptable values will be processed. If the user enters invalid data at any time in the application, the application should display an appropriate error message and prompt the user again until the user enters valid data. See example output above. Look up "validate input console" in index of textbook for help.
17. Generate random number between 0 and 3 inclusive using the Math class. Look up Math class in index of textbook for help.
18. Format currency values where illustrated in example output above. Look up NumberFormat class in index of textbook for help.
19. When the user responds to the continue prompts, the application should only accept a value of "yes" or no. The user will be prompted to continue with the same player and/or prompted to continue with a new player.
20. Add Javadoc comments to describe the purpose of every class in the application.
21. Add Javadoc comments to describe the purpose of every method in the application include complete @param and @return tags in the comments.
22. Upon completion of the application generate the Javadoc documentation file.
23. Create a static filed in the main method for a Scanner object to be used as needed by any static method in the class.
24. The application must contain and implement these ten static methods in the same class with the main method. Name them whatever you like. The functionality they will perform in the application is summarized below:
Welcome to Casino Royale
------------------------
Enter the player's data.
Enter a player’s name: Donna
How much money is Donna willing to put on the table?
Do not enter more than a thousand dollars: one dollar
Error! Invalid number. Try again.
How much money is Donna willing to put on the table?
Do not enter more than a thousand dollars: -1
Error! Number must be greater than 0.0.
How much money is Donna willing to put on the table?
Do not enter more than a thousand dollars: 9000
Error! Number must be less than 1000.0.
How much money is Donna willing to put on the table?
Do not enter more than a thousand dollars: 1000
Error! Number must be less than 1000.0.
How much money is Donna willing to put on the table?
Do not enter more than a thousand dollars: 999
Which type of player is Donna? (P or B) enter in uppercase letters only: b
Check your spelling and enter again.
Which type of player is Donna? (P or B) enter in uppercase letters only: B
Donna has a balance of 999.0 and is a Basic type of player
Donna, what number would you like to wager on?
The valid numbers are between 0 and 3 inclusive.
Donna, enter your number? what
Error! Invalid integer. Try again.
Donna, enter your number? -1
Error! Number must be greater than -1.
Donna, enter your number? 4
Error! Number must be less than 4.
Donna, enter your number? 3
Donna, you can now place a single wager of any size on this number
as long as you have that much money on the table.
Donna, how much do you wager? Your limit is $1.00: 2
Donna, how much do you wager? Your limit is $1.00: -1
Error! Number must be greater than -1.0.
Donna, how much do you wager? Your limit is $1.00: quit
Error! Invalid number. Try again.
Donna, how much do you wager? Your limit is $1.00: .50
Very good. The wheel is spinning.......
The winning number is: 1
Sorry Donna, you lose. You have $998.50 left on the table.
Play again with the same player? (yes/no): yes
Donna, what number would you like to wager on?
The valid numbers are between 0 and 3 inclusive.
Donna, enter your number? 0
Donna, you can now place a single wager of any size on this number
as long as you have that much money on the table.
Donna, how much do you wager? Your limit is $1.00: 1
Very good. The wheel is spinning…….
The winning number is: 0
Congratulations Donna, you have a winning number. You now have $999.50 on the table.
Play again with the same player? (yes/no): no
Play again with a brand new player? (yes/no): y
You must enter yes or no. Try again.
Play again with a brand new player? (yes/no): yes
Enter a player’s name: Rocky
How much money is Rocky willing to put on the table?
Do not enter more than a thousand dollars: 100
Which type of player is Rocky? (P or B) enter in uppercase letters only: P
Rocky has a balance of 100.0 and is a Premium type of player
Rocky, what number would you like to wager on?
The valid numbers are between 0 and 3 inclusive.
Rocky, enter your number? 1
Rocky, you can now place a single wager of any size on this number
as long as you have that much money on the table.
Rocky, how much do you wager? 100
Very good. The wheel is spinning.......
The winning number is: 1
Congratulations Rocky, you have a winning number. You now have $200.00 on the table.
Play again with the same player? (yes/no): yes
Rocky, what number would you like to wager on?
The valid numbers are between 0 and 3 inclusive.
Rocky, enter your number? 0
Rocky, you can now place a single wager of any size on this number
as long as you have that much money on the table.
Rocky, how much do you wager? 200
Very good. The wheel is spinning.......
The winning number is: 2
Sorry Rocky, you lose. You have $0.00 left on the table.
Play again with the same player? (yes/no): yes
Rocky, what number would you like to wager on?
The valid numbers are between 0 and 3 inclusive.
Rocky, enter your number? 3
Rocky, you can now place a single wager of any size on this number
as long as you have that much money on the table.
Rocky, how much do you wager? 50
Error! Number must be less than 11.0.
Rocky, how much do you wager? 10
Very good. The wheel is spinning.......
The winning number is: 0
Sorry Rocky, you lose. You have $-10.00 left on the table.
Play again with the same player? (yes/no): no
Play again with a brand new player? (yes/no): no
Take your money off the table when you leave. Come back soon.