Question: Can someone please help me? This is to be done in Java Write a program that will operate as a coin-flipping game for anyone that

Can someone please help me? This is to be done in Java

Write a program that will operate as a coin-flipping game for anyone that plays the game. Before you dive in and start developing the code, write a pseudocode document that accurately describes the program without using any Java-specific terms or commands. You don't have to develop a flowchart, but you can if you want to. Ask the user how many times he or she would like to flip the coin. Ask the user to choose between heads and tails. Keep track of how many times the coin results in heads, and keep track of how many times the coin results in tails. Display how many times the coin resulted in heads and tails, and then declare a winner. Or if there is a tie, indicate that as well. The user should be able to play the game as many times as he or she would like.

Below you will find what the program might look like. Consider the bold items to be user input:

Coin Flipping Game

Please enter the number of times you would like to flip a coin: 50

Choose heads or tails to win (all lowercase): heads

A coin was just flipped 50 times! The results-- Heads: 23 Tails: 27

You lose.

Would you like to play again? (y/n): y

Please enter the number of times you would like to flip a coin: 50

Choose heads or tails to win (all lowercase): heads

A coin was just flipped 50 times! The results-- Heads: 32 Tails: 18

You win.

Would you like to play again? (y/n): y

Please enter the number of times you would like to flip a coin: 50

Choose heads or tails to win (all lowercase): heads

A coin was just flipped 50 times! The results-- Heads: 25 Tails: 25

It was a tie!

Would you like to play again? (y/n): n

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!