(Solved) : Game Program Purpose Reading Java Code Identifying Essential Components Instance Variables Q34214883 . . .
- A game program
Purpose:
Reading Java code and identifying the essential components -instance variables, method declarations, local variables
Reading and writing Java code that uses the followingconcepts:
Writing appropriate documentation
The Game:
Conditions to win as user
Getting as close to a score of 21 as possible
Having 5 cards and a score of 21 or less
Playing procedure
- The user told about the game, and invited to play
- Four cards are dealt: user, computer, user, computer
- Computer’s cards be hidden, others shown
- User choose: hit to have an additional card; sit/stand not tostop taking card
- Computer take cards once the user finished (sit/stand)
- Computer takes card if their total be less than 16, and usernot bust
Detailed explanation
Pontoon is a card game played with three decks of playing cards(i.e. cards of 2-10, Jack, Queen, King, and Ace from the four suitsof Hearts, Diamonds, Spades, and Clubs).
There are two players: the user of the computer, and thecomputer itself. The object of the game is to beat the other playerby either getting as close to a score of 21 as possible (withoutexceeding 21) or by having 5 cards and a score of 21 or less.
Each card has a value: numeric cards have their numeric value,’face’ cards have value 10, and aces have value 11.
The game is played as follows,
Firstly the user is told about the game and invited to play. Ifthey opt to play then four cards are dealt. The first card goes tothe user, the second to the computer, the third to the user, andthe fourth to the computer. The computer’s card remains hidden, allothers are shown. The user can then indicate they wish to have anadditional card (“hit”). If they are this card is also displayed.Additional cards may be taken until either the user’s score exceeds21 (they “bust”), or they choose not to take another card(“sit”/”stand”). Once the user has finished taking cards thecomputer will take cards. The computer will always take a card iftheir total is less than 16 (and the user’s score doesn’t exceed21).
Requirement:
Files included
– AssigTwo2018.java (The main class/drivenclass with the main method. Do NOT edit!)
– Decks.java (The class for cards and decks. DoNOT edit! Only for invoke)
– Pontoon.java (GUI and action listeners. TheGUI is needed if applicable. MUST be edited!)
Detailed requirements:
– Read and understand the given program
– Modify and redefine (if needed) the class Pontoon (or themethods within it), to organize the game, and interactions with theusers
– Must NOT modify the other two source code files(AssigTwo2018.java & Decks.java)
– create and use objects of Decks class. NO duplicate thingsbelong to Decks class
– use the trace(), switch off before submission
– separate methods to implement separate tasks
– instance variables (used more than one method)
– local variables to store data used by just one method
Targets:
Stage 1: Complete the program to meet the same functions totargetStage1.jar, including the GUI, components, contents, eventhandling, etc.
Stage 2 (optional): Complete the program to meet the samefunctions to targetStage2.jar, including the prompt info onconsole, logics of the program, etc.
Stage 3(optional): complete the program according to theprevious listed requirements, improve the GUI, functions and userexperiences.
TIPS:
Use following commands in console to run a JAR program:
java –jar targetStage2.jar
Provided files:
targetStage1.jar
targetStage2.jar
AssigTwo2018.java
Decks.java
Pontoon.java
Material directory (for Pontoon)
Files can be downloaded from :
https://mega.nz/#!4U1zACAa!razJn-ZYck-3Wv4aQFQMzgDzViJGbex3-ab-JnNvY9Q
Submission requirement
– Including codes only from Pontoon.java for each stage
– Specify within the word file which stage your submission meets(for each section of codes)
Expert Answer
Answer to Game Program Purpose Reading Java Code Identifying Essential Components Instance Variables Q34214883 . . .
OR