Question: The starter code does contain questions at the bottom that must be addressed The starter code does contain formatting mistakes ( including outside the method

The starter code does contain questions at the bottom that must be addressed
The starter code does contain formatting mistakes (including outside the method that students must add code) that must be addressed.
The program initially prompts the user for a seed (to the random number generator) and then for each of 5 simulated coin tosses the program will prompt the user for a guess for coin toss result (0 is heads and 1 is tails) and output the validity of the guess and finally the program will output the cumulative results, as shown below.
The main () method may (not required) call a 'helper method' to accomplish the program purpose.
Your output must match the sample output exactly.
The program must be completed using
only 4 integer variables used to store the user-defined value for the seed, each of the user-defined guess (only one variable is needed to store all of the user-defined guesses), each randomly generated coin flip (only one variable is needed to store all of the coin flips), and the total number of correct guesses
only 1 Scanner object instantiation assigned to a reference variable used to read a seed and the guesses from the user,
only 1 Random object instantiation seeded with a user-defined input and assigned to a reference variable used to generate a 0 or 1 for the coin toss, and
several iflelse statements, and
several print statements.
The code should be written efficiently to
eliminate redundant coding and
eliminate variables used only once.
File name: Cointoss. java
Add a comment with your name, date, and program description at the top
NOTE:
This code is repetitive because the program must flip a coin 5 times. As a result, the code will be lengthy (circa 100 lines long) and will contain repetitive code.
In chapter 6 of the textbook, loops will be introduced, loops would be a more elegant approach to reducing the repetitive code required in this program. However, for this program, length repetitive code will be tolerated.
HINT:
Without Using The For loop!!! Or any loop
 The starter code does contain questions at the bottom that must

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!