Closed

Java Program - HiLo Game

This project received 29 bids from talented freelancers with an average bid price of $33 USD.

Get free quotes for a project like this
Employer working
Skills Required
Project Budget
$10 - $30 USD
Total Bids
29
Project Description

Write a program to implement a simple “Hi-Lo” game using a standard deck of 52 playing cards. Your game should ask the user to enter their bankroll. Your program must verify that the user enters a positive real number. If the user did not enter a positive real number, continue to prompt them to enter their bankroll until they do so. 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, 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, 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 less than $100.00. Draw a card and display it for the user. Ask the user if they think the next card will be higher or lower than the card which was drawn. 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 the same, continue to draw the second card until a different card is drawn. If the user guessed correctly add the amount of the bet to their bankroll. If the user guessed incorrectly, subtract the amount of the bet from their bankroll. 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 user’s bankroll. Display the amount in the user’s bankroll after each play of the game before asking whether the user wants to play again.

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online