Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the game of Lucky Sevens, the player rolls a pair of dice. If the dots add up to 7, the player wins $4; otherwise,

In the game of Lucky Sevens, the player rolls a pair of dice. If the dots add up to 7, the player wins $4; otherwise, the player loses $1. Suppose that, to entice the gullible, a casino tells players that there are lots of ways to win: (1, 6), (2, 5), and soon. A little mathematical analysis reveals that there are not enough ways to win to make the game worthwhile; however, because many people's eyes glaze over at the first mention of mathematics wins $4, your challenge is to write a program that demonstrates the futility of playing the game. Your program should take as input the amount of money that the player wants to put into the pot, and play the game until the pot is empty.

The program should have at least TWO functions (Input validation and Sum of the dots of users two dice). As the program 1, your code should be user-friendly and able to handle all possible user input. The game should be able to allow a user to ply several times.

The program should print a table as following:

Number of rolls Win or Loss Current value of the pot

1 Win $104

2 Loss $103

3

At that point the players pot is empty (the Current value of the pot is zero), the program should display the number of rolls it took to break the player, as well as maximum amount of money in the pot during the playing.

Again, add good comments to your program.

Test your program with $10, $20, and $50.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

Question What are the requirements for a SIMPLE 401(k) plan?

Answered: 1 week ago