Question
Write a program to implement a simple Hi-Lo game using a standard deck of 52 playing cards. The game should ask the user to enter
Write a program to implement a simple Hi-Lo game using a standard deck of 52 playing cards. The game should ask the user to enter their bankroll. Your program must verify that the user enters a positive real number. But, if the user doesn't enter a positive real number I need to continue to prompt them to enter their bankroll until they do. After a valid bankroll has been entered the program should continue to repeat until either the user indicates that they want to quit or until there is no money remaining in their bankroll. When the game ends, I need to display for the user: the total number of games played, total number of wins, total number of losses, total number of ties and the ending amount in their bankroll.
For each play of the game:
1. Ask the user to enter their bet. Verify that the user has sufficient funds remaining in their bankroll to cover the bet and that the bet is between $0.01 and $100.00.
2. Draw a card and display it for the user.
3. Ask the user if they think the next card will be higher or lower than the card which was drawn.
4. Draw a second card making sure that it is different in some way (either face, suit or both) from the first card drawn. If the card is exactly the same (e.g., both are the Ace of Clubs), continue to draw the second card until a different card is drawn.
5. Display the result for the user.
a. If the user guessed correctly add the amount of the bet to their bankroll.
b. If the user guessed incorrectly, subtract the amount of the bet from their bankroll.
c. If the second card drawn is a card of the same face value but a different suit, the game is a tie and no change should be made to the users bankroll.
6. Display the amount in the users bankroll after each play of the game before asking whether the user wants to play again.
I do have a template I need to use but are you able to help me without it? I don't need anything complex as this should be more on the basic side of coding due to the course I'm taking and what we've learned so far.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started