python3 programing!! Make a program that takes bets on horse races. There will be four types of bets described below. The horse race result is generated by a function a function called ReadySetgo that simply scrambles the horses into random order as a “psuedo/simulated” horse race and that tells you the race results. I will provide you with the code for your ReadysetGo function as shown above you can just call shuffle to simulate the race. We assume four horses run in a race, and we assume the horses are named by numbers 1-4. Let’s say the horses are initially in the order 1 2 3 4. If you call Readysetgo to randomly shuffle them (that’s our pseudo-race) we might get a race result of 2 1 4 3 for example, which means: horse #2 came in first, horses #1 came in second, horse #4 came in third and horse # 3 came in fourth. The user starts out with 200 dollars. Betting costs are as follows: An Exacta bet costs 10 dollars, and an Exactabox bet costing 5 dollars, a Trifecta bet costs 25 dollars, and a Trifectabox bet costs 20 dollars. Advanced students you can (but are not obligated to) make this bet cost programmable, ie some students allow the user to decide how much they want to bet on the race, and some even let the user borrow money and get more in debt if they keep on losing and run out their 200 dollars) We need our program to allow the user to place any of the four types of bets. The user is given a USD (US dollars) cash balance of 200 dollars for betting. The menu options allow the user to place any of the four bets, run the race, see the result, see what their cash balance is, and exit the program. Advanced students if you wanted to, you could save a history of the bets they placed so they could also ask for their betting history. There are two easy ways to implement the user interface for this, one is going to be with a simple text based menu, and one is going to be with a simple string/command-line based menu. A text menu is where you give the user a choice of options and tell them for example: enter 1 to place an exactabet, enter 2 to place an exactabox bet, etc. ie: Welcome to Horse Betting! Please select from the following options 1-6 Place an exact bet Place an exactabox bet Place a trifectabet Please a trifectabox bet See your USD balance Exit They then choose the option they want and then you ask them what horses they pick as the winners, get their pick, run the race, see if they won, etc. A text based menu is going to be the better choice to implement if you are a beginner. A string based menu is a slightly different input style, where the input is more of a command-line driven sentence that gets parsed into components in the program to determine what they want, for example, if the user inputs the command line sentence > exacta 1 2 the program will read that in, divide that up into the components and figure out that they are placing an exacta bet with horse 1 and 2 as the picks. what the four bets mean (I will also be showing you some intro horse betting videos to help you understand how exacta and trifecta betting works if you have never been to the racetrack). EXACTA bets cost 10 dollars to place but you win 100 dollars if you guess the exact winning order of the top two horses. An EXACTABOX bet costs 5 dollars to place but you win 25 if you guess the top two horses in any order. TRIFECTA bets cost 25 dollars to place but you win 200 dollars if you guess the exact winning order of the top three horses. An TRIFECTABOX bet costs 20 dollars to place but you win 150 if you guess the top three horses in any order.
python3 programing!!
Make a program that takes bets on horse races. There will be four types of bets described below. The horse race result is generated by a function a function called ReadySetgo that simply scrambles the horses into random order as a “psuedo/simulated” horse race and that tells you the race results. I will provide you with the code for your ReadysetGo function as shown above you can just call shuffle to simulate the race.
We assume four horses run in a race, and we assume the horses are named by numbers 1-4.
Let’s say the horses are initially in the order 1 2 3 4. If you call Readysetgo to randomly shuffle them (that’s our pseudo-race) we might get a race result of 2 1 4 3 for example, which means: horse #2 came in first, horses #1 came in second, horse #4 came in third and horse # 3 came in fourth.
The user starts out with 200 dollars. Betting costs are as follows: An Exacta bet costs 10 dollars, and an Exactabox bet costing 5 dollars, a Trifecta bet costs 25 dollars, and a Trifectabox bet costs 20 dollars. Advanced students you can (but are not obligated to) make this bet cost programmable, ie some students allow the user to decide how much they want to bet on the race, and some even let the user borrow money and get more in debt if they keep on losing and run out their 200 dollars)
We need our program to allow the user to place any of the four types of bets. The user is given a USD (US dollars) cash balance of 200 dollars for betting. The menu options allow the user to place any of the four bets, run the race, see the result, see what their cash balance is, and exit the program. Advanced students if you wanted to, you could save a history of the bets they placed so they could also ask for their betting history.
There are two easy ways to implement the user interface for this, one is going to be with a simple text based menu, and one is going to be with a simple string/command-line based menu. A text menu is where you give the user a choice of options and tell them for example: enter 1 to place an exactabet, enter 2 to place an exactabox bet, etc.
ie:
Welcome to Horse Betting!
Please select from the following options 1-6
- Place an exact bet
- Place an exactabox bet
- Place a trifectabet
- Please a trifectabox bet
- See your USD balance
- Exit
They then choose the option they want and then you ask them what horses they pick as the winners, get their pick, run the race, see if they won, etc. A text based menu is going to be the better choice to implement if you are a beginner. A string based menu is a slightly different input style, where the input is more of a command-line driven sentence that gets parsed into components in the program to determine what they want, for example, if the user inputs the command line sentence
> exacta 1 2
the program will read that in, divide that up into the components and figure out that they are placing an exacta bet with horse 1 and 2 as the picks.
what the four bets mean (I will also be showing you some intro horse betting videos to help you understand how exacta and trifecta betting works if you have never been to the racetrack).
EXACTA bets cost 10 dollars to place but you win 100 dollars if you guess the exact winning order of the top two horses.
An EXACTABOX bet costs 5 dollars to place but you win 25 if you guess the top two horses in any order.
TRIFECTA bets cost 25 dollars to place but you win 200 dollars if you guess the exact winning order of the top three horses.
An TRIFECTABOX bet costs 20 dollars to place but you win 150 if you guess the top three horses in any order.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images