Write a program that starts a player off with a bank of


INPUT VALIDATION: Do not allow the user to divide by zero when division is selected If the user does not enter a valid operator display an error with the default case.

The program should ask the user at the end of displaying the result to the user if the user would like to compute another calculation (y/n) if the user, enters y, the program should loop back to the beginning. If the user enters n, the program should continue to the return 0 statement

Assignment

Write a program that starts a player off with a bank of $15.00. A coin will flip and randomly choose heads or tails the user wilt guess heads or tads to Mn' If the coin flip matches the player's guess his bet will be doubled. It costs 1 dollar to play and the program will bet that amount automaticity each *me as long as there is the available bank amount.

 


C:\WINDOWS\system32\cmd.exe

Welcome to the coin flip game.

It will cost 1 dollar to play

If you guess correctly, you will match your bet one to one

Would you like to play?

Y

Guess heads or tails and I will tell you if you guessed correctly

h

the coin landed on Tails

i an sorry, but you did not win this time. your hank balance is :$14.00

would you like to play again?

y

Guess heads or tails and I will tell you if you guessed correctly

T

the coin landed on Tails you WIN $2.00

your hank balance is :$16.00

would you like to play again ?(Y/N)

would you like to play again?

thank you for playing_ Your hank balance is $16.00 Press any key to continue . . .

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a program that starts a player off with a bank of
Reference No:- TGS01130868

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)