Homework

Homework Questions? Ask a Tutor for Answers ASAP

Connect one-on-one with {0} who will answer your question

Related Homework Questions
Java. I have a little bit of code. I need this completed in
i need this completed in 1 hour Player Class Specification The Player class represents a player that will play a simple game. In this game, a player can play the number 0, 1, or 2. The Player class contains the following four fields: private String name; private int play; private int [] tally; private StringBuffer history; The Player class contains the following 2 constructors and 5 methods that you must implement: 1. Constructor with String parameter – If the argument is null, throw the IllegalArgumentException with the message "Invalid parameter", otherwise set the name field. Set play to 0, assign an int array to tally (you can decide the size of the array), and an empty StringBuffer to history. This constructor will be referred to as “the constructor” in the remainder of the text. 2. Copy Constructor – Make sure the copy is completely independent of the original with no shared fields. 3. getPlay – get method for the play field. 4. setPlay - If the argument is anything other than 0, 1, or 2 , throw the IllegalArgumentException with the message "Invalid parameter", otherwise set the play field. You are free to update other fields as you see fit in this method. 5. getHistory – returns the history of the player. The history will be each play followed by one space after the play(there will even be a space after the last play). For example, if the player plays a 2, followed by a 0, followed by a 1, the content of the history will be 2 0 1 Note: The history never contains the original 0 assigned as the default value of play using the constructor. Hint: Beware of a privacy leak. (Please do not post to piazza asking what is meant by a privacy leak. You should know this from the lectures) 6. reset – After this method is invoked on a player object, the player object should be in the same state as it would be if it was just constructed using the constructor. 7. getTally – Will return a string that represents the frequency of each play of the player. For example, the following: 0: ******** 1: ****** 2: ****** means the player has played 8 zeros (because there are 8 *), 6 ones, and 6 twos. See the sample driver for another example. PlayGame Class Specification The PlayGame class contains one static method, play, that allows 2 players to play the simple game. The rules are as follow: There are only 3 values that can be played: 0, 1, 2 In each round, each of the 2 player picks one of the three values. If both players, pick the same value, the round is a tie. A 2 beats a 1, a 1 beats a 0, and a 0 beats a 2 (this last rule is a little counter intuitive, so just to repeat, a player that picks a 0 will win over the player who picks a 2) The PlayGame class contains the following static method that you must implement: 1. play -This method will simulate 10 rounds of the game and return a string that shows the result of each round as well as the overall winner of the game (or report a tie). For each round, first set the play of player 1 then set the play of player 2. To get a value that is either 0,1,or 2, you must use the following call: random.nextInt(3) For each round, figure out who the winner is (it might be a tie) and concatenate the string you form to the string that the method will return. For example, the text for round 1 might be: Round 1 - P1: 0, P2: 1, result: P2 Wins See the Sample Driver output for more examples. Feel free to add private helper static methods to help you implement the necessary logic of who wins a round. After the 10 rounds, you need to have one additional line that reports the winner (whoever won the most game, or a tie if both have the same number of wins). For example, the text might be: P1 total: 2, P2 total: 3, Winner: P2 See the Sample Driver output for more examples. this is the requirement … read more
Expert
Expert
Can you help me with a Python problem? Do I sent it in this
Can you help me with a Python problem? JA: Have you begun working on a solution? What Python code do you have so far? Customer: Yes, do I sent it in this chat? JA: What are the full requirements for t… read more
Expert
Expert
I need help with a java program question. Getting stuck on a
i need help with a java program question JA: I'll do all I can to help. Can you tell me more about what's going on? Customer: Getting stuck on a java questio JA: Is there anything else the Expert shou… read more
R.R. Jha
R.R. Jha
Bachelor's Degree
6,909 satisfied customers
This game will be written in java code. Create a class named
This game will be written in java code. Create a class named RandomGame with a main method and any additional methods that you think will help your program be efficient and readable. For this project,… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
18,409 satisfied customers
LogicPro, I need help on this Java problem. In the game of
HI LogicPro, I need help on this Java problem.In the game of Hartzee the player rolls two dice and the computer rolls two dice. If the player rolls double-6s, they win! Otherwise, if they roll doubles… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
18,409 satisfied customers
CAN YOU HELP WITH ASSIGNMENT PART NOT LAB? LAB IS DONE
CAN YOU HELP WITH ASSIGNMENT PART NOT LAB? LAB IS DONE CREATE DIRTY DICE GAME C++??Objectives: implement a real application with all the challenges associated with it ▪ Understand the idea of modular … read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
18,409 satisfied customers
Please look at it and what I have done it is kind of ready but needs s
Please look at it and what I have done it is kind of ready but needs some stuff let me know if you can finish it by 9 pm? http://wikisend.com/download/254500/YahtzeePlayer.java This PA will involve yo… read more
Mr. Gregory White
Mr. Gregory White
1,269 satisfied customers
for my first program, i just need help getting the program
NEED help with a class (spinnerGame) which runs a simulation of two people playing a game with a spinner. The game is easy- Spin a wheel which contains the following eight values: +5 +3 +2 +1 -‐‐1 -‐‐… read more
Mr. Gregory White
Mr. Gregory White
1,269 satisfied customers
Write a Java program that plays a two player dice game called
Write a Java program that plays a two player dice game called Guts. The rules of the game are Players take turns rolling a single 6 sided dice. If a player rolls a 1, then the turns ends and the playe… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
18,409 satisfied customers
Write a java application that generates the roll of two (six
Write a java application that generates the roll of two (six sided) dice ten times. Write a method (doubles) which will return true if both random numbers are the same. Write another method (sevens) w… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
18,409 satisfied customers
Help! I need this programmed in Java. To play craps, a
Help! I need this programmed in Java. To play craps, a player rolls two dice repeatedly until he wins or loses. If he makes a 7 or an 11 on the first roll, he wins immediately. An initial roll of 2, 3… read more
ATLProg
ATLProg
Software Engineer
Master's Degree
9,151 satisfied customers
I see this question has already been asked and there is an
I see this question has already been asked and there is an answer available: Requirements Pig is a folk jeopardy dice game with simple rules: Two pla yers race to reach 100 points. Each turn, a player… read more
ATLProg
ATLProg
Software Engineer
Master's Degree
9,151 satisfied customers
Write a program that allows a single Player (the user) to play
Write a program that allows a single Player (the user) to play a simple two dice game of chance against a single Opponent (the computer). Game Description: There is a single Player (human), with two d… read more
Raj
Raj
SAP ABAP Consultant
Master's Degree
365 satisfied customers
This is what I have so far, what I need is the main game loop
This is what I have so far, what I need is the main game loop to execute the dealing of random cards to each player, update the display and determine and display the winner. Can you help me? // Descri… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
18,409 satisfied customers
Im pulling my hair out over this one... I need to write this
I'm pulling my hair out over this one... I need to write this program for both Visual Logic and Python 3.2.3. by December 10th. You will create a version of a dice game called Pig, played against the … read more
Mr. Gregory White
Mr. Gregory White
1,269 satisfied customers
You are required to implement a program that will play the
You are required to implement a program that will play the game of NIM. This is a two player game where a randomly sized set of straws is used. Each player takes turns to remove from 1 to 3 straws fro… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
18,409 satisfied customers
I am writing a code of a SNAKE EYES game. The user always
I am writing a code of a SNAKE EYES game. The user always begins by rolling the dice, maintaining a running count of their point total up to this step, including points won in previous rounds. The use… read more
Raj
Raj
SAP ABAP Consultant
Master's Degree
365 satisfied customers
Pig is a folk jeopardy dice game with simple rules: Two players race to reac
Pig is a folk jeopardy dice game with simple rules: Two players race to reach 100 points. Each turn, a player repeatedly rolls a die until either a 1 ("pig") is rolled or the player holds and scores t… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
18,409 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here.

DianeDallas, TX

< Previous | Next >

Meet the Experts:

Scott

Scott

MIT Graduate

5,558 satisfied customers

MIT Graduate (Math, Programming, Science, and Music)

LogicPro

LogicPro

Engineer

18,409 satisfied customers

Expert in Python,Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Manal Elkhoshkhany

Tutor

4,775 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

Chris M.

M.S.W. Social Work

2,852 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

F. Naz

Chartered Accountant

2,273 satisfied customers

Experience with chartered accountancy

Bizhelp

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

< Previous | Next >

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x