Mid-Term Programming Exam 7/2/20, 1:26 AMMid-Term Programming Exam is Due Page 1 of 4https://alamo.instructure.com/courses/1284085/assignments/9089561?module_item_id= XXXXXXXXXX Mid-Term Programming...

Its all self explanatory in the files, however, comments are important.


Mid-Term Programming Exam 7/2/20, 1:26 AMMid-Term Programming Exam is Due Page 1 of 4https://alamo.instructure.com/courses/1284085/assignments/9089561?module_item_id=15646344 Mid-Term Programming Exam is Due Due Sunday by 11:59pm Points 100 Submitting a file upload File Types zip, rar, and zipx Available after Jul 2 at 12am Submit Assignment Send me a message in Canvas if you have any questions about this project. Ask questions well in advance (at least 12 hours) of the project due date of midnight in order to ensure a timely response. Do not discuss this project with other students in the class or in the discussion area. This is an individual effort only. Partial credit will be awarded if the programs submitted are not 100% according to the given specifications below. As stated in the syllabus, a late exam submission will not be accepted and a grade of 0 will be assigned. Midterm Programming Exam This application is designed to help you practice some of the concepts from chapters 7 - 10. Use the textbook index to lookup concepts that may be unfamiliar to you. Casting is important. Don’t forget to use the debugging techniques you learned in reading assignment 2 from chapter 6. Read the entire exam before starting. Create the application according to the specifications below. The game will only have one player. Example Console Display Test ExampleOutput Specifications 1. Do NOT use arrays or any collections in this application. 2. There are many ways to design a solution to this problem but you are graded on meeting the specific specifications as given in this exam. 3. The game will only have one player play at a time. 4. Use proper statement indentation and meaningful variable names in the code. (2 points) 5. Place a multi-line Javadoc comment (not multiple single line comments) giving a description of what this application does before the class header. Include your name and the date: (2 points) 6. Output spacing, formatting, and spelling are to match the example console output illustrated https://alamo.instructure.com/courses/1284085/files/162812930/download https://alamo.instructure.com/courses/1284085/files/162812930/download Lyann Nicolle Lyann Nicolle Lyann Nicolle Lyann Nicolle Lyann Nicolle 7/2/20, 1:26 AMMid-Term Programming Exam is Due Page 2 of 4https://alamo.instructure.com/courses/1284085/assignments/9089561?module_item_id=15646344 above, but of course the user input will be different. (2 points) 7. Create and use an interface with two constants named PREMIUM and BASIC. Include an abstract method called printPlayer that has a String parameter and does not return any values. (4 points) 8. Create a superclass named Player that implements the interface. It has five instance variables. One is for the player’s name, one for the amount of money the player has, one for the player’s wager, and one for the player’s guess, and one for the player type. The types are declared in the interface. Create getter and setter methods for all the instance variables. Implement the print method so it prints all the Player object's data values with the type formatted with the first letter in uppercase and the remaining letters in lowercase. (4 points) 9. Create two Player constructors. One will have no parameters and one will have the name and the amount of money parameters. (2 points) 10. 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. (4 points) 11. You must use this superclass and its subclasses in the application to create player objects. (4 points) 12. 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. (4 points) 13. The basic player has an enforced betting limit of $1 even if they have more than $1 on the table. (4 points) 14. Add and use the Console class from chapter 7 or a modified version to validate user input data. (3 points) 15. 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. (3 points) 16. Prompt the user for data and store this data in memory. 17. 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 console display test above. See example console display file. (3 points) 18. Generate random number between 0 and 3 inclusive using the Math class. (2 points) 19. Format currency values where illustrated in example output above. Look up NumberFormat class Lyann Nicolle 7/2/20, 1:26 AMMid-Term Programming Exam is Due Page 3 of 4https://alamo.instructure.com/courses/1284085/assignments/9089561?module_item_id=15646344 in index of textbook for help. (2 points) 20. 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. (3 points) 21. Add Javadoc comments to describe the purpose of every class in the application. (2 points) 22. Add Javadoc comments to describe the purpose of every method in the application include @param and @return comments. (2 points) 23. Upon completion of the application generate the Javadoc documentation file. Be sure it includes the entire application documentation and verify that the Javadoc generated files are included in your submission. (4 points) 24. The application must contain and implement these ten static methods. Name them whatever you like. The functionality they will perform in the application is summarized below: Main method- This method will declare and initialize necessary entities and control execution of the code. Anything not handled is the other methods will be accomplished by the main method. (6 points) Random number generator method- This method will generate a value between 0 and 10. (2 points) Initial welcome display - This method will display the welcome information.(2 points) Winning method - This method determines the three winning numbers. It then calls the method which determines if the player wins or loses and displays the appropriate information to the user. (5 points) User wage validation and input method- This method will display the wager information and will prompt, accept, and validate the user’s wagers (5 points) Winning message method - This method determines if the player wins or loses and displays the appropriate information to the user. (6 points) User guess validation and input method- This method will display the guessing information and will prompt, accept, and validate the user’s guess. (4 points) Create player– This method will prompt, accept, and validate the data needed to create a player object. It will also call the Player's print method. (6 points) Play again with same players– This method will prompt, accept, and validate the data needed to continue playing with the same players that started and print appropriate information in response. (4 points). Play again with new players– This method will prompt, accept, and validate the data needed to continue playing with brand new players from the beginning and print appropriate information in response. (4 points). Lyann Nicolle 7/2/20, 1:26 AMMid-Term Programming Exam is Due Page 4 of 4https://alamo.instructure.com/courses/1284085/assignments/9089561?module_item_id=15646344 Zip the project folder and submit it for the Mid-term programming exam assignment in Canvas just like you do for the end-of-chapter assignments. Lyann Nicolle Example Console Display Test 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? (PREMIUM or BASIC) enter in uppercase letters only: basic Check your spelling and enter again. Which type of player is Donna? (PREMIUM or BASIC) enter in uppercase letters only: BASIC 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 same players? (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: 2 Sorry Donna, you lose. You have $997.50 left on the table. Play again with same players? (yes/no): no Play again with brand new players? (yes/no): y You must enter yes or no. Try again. Play again with brand new players? (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? (PREMIUM or BASIC) enter in uppercase letters only: PREMIUM Rocky has a balance of 100.0 and is
Jul 02, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here