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
Also have a good day people !!
anastassius [24]

Answer:

Thx u2!!

Explanation:

Everyone have a good day!

6 0
2 years ago
Read 2 more answers
Which of the following is 1000 of a second​
s344n2d4d5 [400]

Answer:

what I don't understand your question

6 0
4 years ago
Please what do you guys think about this ?
Y_Kistochka [10]

Answer:itsjust black

Explanation:

Black thoughts

3 0
3 years ago
Read 2 more answers
A game developer is purchasing a computing device to develop a game and recognizes the game engine software will require a devic
ale4655 [162]

Answer: Server

Explanation:

Options include:

A.Laptop

B.Server

C.Game console

D.Workstation

A server is referred to as a computer that helps in the provision of services, data or resources to other systems over a particular network.

Since the game developer wants a computing device to develop a game and recognizes the game engine software will require a device with high-end specifications that can be upgraded, the server is the best option for this.

5 0
3 years ago
What direction would a sprite go if you constantly increased its x property? Your answer What direction would a sprite go if you
Korvikt [17]

Answer:

decrease x property,It would go left

decrease y property, it would go down

yes

Explanation:

8 0
3 years ago
Other questions:
  • From the video "Your Password Sucks", using computer power to guess your password by trying multiple variations one after the ot
    15·2 answers
  • The use of computers to combine data from multiple sources and create electronic dossiers of detailed information on individuals
    8·1 answer
  • Which word processing file that contains text and other
    13·2 answers
  • Then standard toolbar appears whenever you select text true or fals
    15·1 answer
  • Which type of microphone uses two metal plates?
    7·1 answer
  • 10.7 LAB: Fat-burning heart rate Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus th
    8·1 answer
  • Systems Software, Inc., is introducing a new piece of sophisticated graphics software. A recently hired writer has been assigned
    8·1 answer
  • Why would it be hard to find the ideal CO2 level if the light intensity were very low?
    9·1 answer
  • Which of these lines of code will increment a variable?
    11·1 answer
  • Examples of system software include operating systems like macos, Linux, Android and
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!