1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
LenKa [72]
3 years ago
8

Write a program that asks the user to guess the next roll of a six-sided die. Each guess costs $ 1. If they guess correctly, the

y get $ 100.00. The player will start out with a $10.00 bank. Each time he (or she) guesses incorrectly you will subtract $1.00 from their bank. Each time they guess correctly, you add $10.00 to their bank. Print the total winnings or losses at the end of the game. You can simulate the toss of the dice using the RandomRange function (Don't forget to Randomize).
Computers and Technology
1 answer:
jasenka [17]3 years ago
3 0

Answer in python:

import random

money = 10

winnings = 0

def main():

global winnings

global money

dice_num = random.randrange(1,6)

input_str = "Guess the dice number. You have $"+str(money)+" > "

input_num = input(input_str)

if int(input_num) == dice_num:

 money = money + 10

 winnings = winnings + 10

else:

 money = money - 1

if money < 0:

 print("You lose. You won "+str(winnings)+" times. Press enter to try again")

 useless_variable = input()

 main()

else:

 main()  

main()

Explanation:

You might be interested in
You can put a small level on your camera to help keep the horizons straight? TRUE OR FALSE
anastassius [24]
The answer is true and i believe it is best to put it at the 4 intersecting points<span />
5 0
3 years ago
Read 2 more answers
0.005098 megaliters to liters. record your answer in whole liters
Dmitriy789 [7]
Your answer would be 5098 liters.

Reason being, because there are 1,000,000 liters in one megalitre, so you just multiply 0.005098 by 1,000,000 to get your answer of 5098 liters.
6 0
3 years ago
What is the following file format called? inv_nbr, inv_name, inv_cost 876521,battery,45.00
kiruha [24]

The  following file format of  inv_nbr, inv_name, inv_cost is called delimited format.

<h3>What is a delimited file in Excel?</h3>

The term "Delimited" is known to be a term that connote a form of  an  TXT file that tends to make use of tabs or an  CSV file that uses commas to  be able to separate and group your data.

Note also that a  delimited file is seen as a form of a given sequential file that is made up of column delimiters.

Therefore, The  following file format of  inv_nbr, inv_name, inv_cost is called delimited format.

Learn more about text format from

brainly.com/question/16397886

#SPJ1

Multiple Choice

fixed-width format

extensible markup

delimited format

hypertext format

6 0
1 year ago
Which of the following statements are true?
grin007 [14]

Answer:

I think the answer are two which are B and C

7 0
3 years ago
The state licensing bureau recently conducted a survey at Community Hospital. During this review, the surveyors determined that
marshall27 [118]

Answer: Opportunity for Improvement

Explanation:

Any healthcare organization, service, or process that does not reach the established standard or the customer's expectations, is an opportunity for improvement. Furthermore, the Improving Medicare Post-Acute Care Transformation Act (IMPACT) established a quality reporting program aimed to find those opportunities for improvement. Once the problem has been established, is prudent to place an action plan to achieve the desired performance improvement aim.

3 0
3 years ago
Other questions:
  • Once you have selected the range of cells for your table data, from which tab can you open the Insert Table dialog box?
    6·2 answers
  • Anti-bullying laws in most states are designed to provide
    14·2 answers
  • A four year old laptop will not boot and presents error messages on the screen
    8·1 answer
  • Martha wants to invite her coworkers to her birthday party. She uses the mail merge feature to compose and send the invitations.
    6·1 answer
  • A very simple device that connects network components and sends packets of data to all other connected devices is called a _____
    5·1 answer
  • What important feature of an email gives you a clue about what the sender wants to tell you?
    12·2 answers
  • What to do if your monitor is not displaying a picture
    12·1 answer
  • What is software piracy?
    11·1 answer
  • Who would win in a fight iron man or bat man​
    5·2 answers
  • In java I need help on this specific code for this lab.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!