Question: can you write this in java and use jGrasp becasue for me package files dont work USE JGRASP AND TAKE YOUR TIME PEOPLE KEEP ANSERING

can you write this in java and use jGrasp becasue for mepackage files dont work USE JGRASP AND TAKE YOUR TIME PEOPLE KEEPcan you write this in java and use jGrasp becasue for me package files dont work USE JGRASP AND TAKE YOUR TIME PEOPLE KEEP ANSERING BUT ITS INCORECT

REMEMBER

1. USE JGRASP

2. IN JAVA

3.TAKE YOUR TIME AND DO IT RIGHT

4. THANK YOU

Example run 2 You will develop two classes for this lab: the Coin class and a Client class that uses instances of the Coin class for playing a game Round 1: Quarter i HEADS The objective of the game is to total your coins to exactly one dollar. The game requires three instances of the Coin class: one representing a quarter, one representing a dime and one representing a nickel. When the game begins, your starting balance is $0. During each round of the game, the program will toss the simulated coins. When a coin is tossed, the value of the coin is added to your balance if the coin lands heads-up. For example, if the quarter lands heads-up, 25 cents is added to your balance. Nothing is added to your balance for coins that land tails-up. The game is over when your balance reaches one dollar or more your balance is exactly one dollar, youwin the game You lose if your balance exceeds one dollar or if you quit the game. The Coin class should be defines as follows: our toal io nav 40 Another round? Yor): 7 Baand 2 Quarter is HEADS Your total ia nav 1 Another round? ( or N): Baund 3: Fields: Quarteris TAILS value-face value of the con sideUp-a string that holds HEADS or TAILS indicating the side of the coin that is facing up Your total is now 75 Rnother round? (T or ): Round Quarter is HEADS A constructor that receives an integer value representing the face value of the coin. Only quarters, dimes, nickels, and pennies should be allowed. If the integer received does not meet this criteria, the value field should be set to 1 (penny is the default.) Your total is how 105 oxy, yo lose! . A void method named toss that simulates the tossing of the coin. When the toss method is called, it randomly determines the side of the coin that is facing up and sets the sideUp flield accordingly . A method named getSideUp that returns the value of the sideUp field .A method named getValue that returns the face value of the coin. Hint: The Random class is discussed in Chapter 4 or you can look at Math.randomO in the Java API Example run 3 Example run 1 Round 2 Quarte1.0 HEADS arter an HEADS ize is TAILS Another round? (Y :N): Round carter HEDS Your cota1 18 no 65 Another roana? ( O N): n Congreeulatiess, you win Example run 2 You will develop two classes for this lab: the Coin class and a Client class that uses instances of the Coin class for playing a game Round 1: Quarter i HEADS The objective of the game is to total your coins to exactly one dollar. The game requires three instances of the Coin class: one representing a quarter, one representing a dime and one representing a nickel. When the game begins, your starting balance is $0. During each round of the game, the program will toss the simulated coins. When a coin is tossed, the value of the coin is added to your balance if the coin lands heads-up. For example, if the quarter lands heads-up, 25 cents is added to your balance. Nothing is added to your balance for coins that land tails-up. The game is over when your balance reaches one dollar or more your balance is exactly one dollar, youwin the game You lose if your balance exceeds one dollar or if you quit the game. The Coin class should be defines as follows: our toal io nav 40 Another round? Yor): 7 Baand 2 Quarter is HEADS Your total ia nav 1 Another round? ( or N): Baund 3: Fields: Quarteris TAILS value-face value of the con sideUp-a string that holds HEADS or TAILS indicating the side of the coin that is facing up Your total is now 75 Rnother round? (T or ): Round Quarter is HEADS A constructor that receives an integer value representing the face value of the coin. Only quarters, dimes, nickels, and pennies should be allowed. If the integer received does not meet this criteria, the value field should be set to 1 (penny is the default.) Your total is how 105 oxy, yo lose! . A void method named toss that simulates the tossing of the coin. When the toss method is called, it randomly determines the side of the coin that is facing up and sets the sideUp flield accordingly . A method named getSideUp that returns the value of the sideUp field .A method named getValue that returns the face value of the coin. Hint: The Random class is discussed in Chapter 4 or you can look at Math.randomO in the Java API Example run 3 Example run 1 Round 2 Quarte1.0 HEADS arter an HEADS ize is TAILS Another round? (Y :N): Round carter HEDS Your cota1 18 no 65 Another roana? ( O N): n Congreeulatiess, you win

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!