Background We covered classes and objects in class this week. Lab 10 asks you to create a Coin class from scratch. You won’t modify the starter file, CoinTester.java, at all. After you add Coin.java...

1 answer below »

Background


We covered classes and objects in class this week. Lab 10 asks you to create a Coin class from scratch. You won’t modify the starter file,
CoinTester.java, at all. After you add Coin.java to your directory, CoinTester.java should run without error and match the sample output.




Exercise


Your job is to build the Coin.java class, which will be used as the blueprint for Coin objects inside of
CoinTester.java. You must look at
CoinTester.java
to see the methods (flip(), reset(), and more!) and private fields that the Coin class needs to have. Once you have all of the requirements of the Coin class, you can build it.




Remember the things you will need for Coin.java:




  • Constructor method that takes in no arguments. The constructor should create a Random object.




  • Each of the Coin methods that are called in
    CoinTester.java




  • Private variables to keep track of important values.






Your submission should include only Coin.java. There should be no changes necessary to CoinTester.java. Remember, you might get errors inside CoinTester.java, which means there is a problem with the Coin.java code. CoinTester.java is tested and should work without any changes!



Answered Same DayApr 06, 2021

Answer To: Background We covered classes and objects in class this week. Lab 10 asks you to create a Coin class...

Mohd answered on Apr 07 2021
140 Votes
Completed solution/Coin.java
Completed...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here