Question: I have to write this code for my java class and I'm not totally sure how to do it. The starter files are given below

I have to write this code for my java class and I'm not totally sure how to do it. The starter files are given below in order. The second file is the one that needs code written in it. If you can somehow help me do this that would be great! Thanks!  I have to write this code for my java class and
I'm not totally sure how to do it. The starter files are
Source file that will test the code we write.
given below in order. The second file is the one that needs
Actual file we need to write the code in!
code written in it. If you can somehow help me do this

Reverse Engineering a Class You are given the main program and the output produced by it. You must write the Coin class, a file named Coin java which will satisfy the class definition required by CoinTester java. Be sure to write your coin.java in the same directory with CoinTester.java Your leader will explain the task and begin suggesting what you do each step of the way by looking at each call made by the tester program and seeing exactly what that call returns. Your leader will then ask you to write that constructor or method in the Coin java file. Your leader will walk around and give as much help as needed for you to get it working. Just do it one step at a time. Write ONE method at a time then compile Coin java and test with the Tester. Look at the main and see how the Coin class is constructed and what methods are called. From those observations, you can deduce the private data members and public methods with their exact naming and data type. Note that when a coin object is created, it's internal head and tail counts are initialized to zero. Each time a coin is.flip()'d that flip increments that coin's heads or tails counts with a 50% each probability. Thus, you must use a Random variable inside your coin class to get a 50/50 chance of getting a head or tail. Once the flip method decided that a head or tail was rolled, the flip method increment the appropriate counter and then returns "H" or "T". The reset() method starts that coin's counters back at 0. CoinTester java & Coin.java

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!