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
Which of the following should be the first page of a report?
hram777 [196]

Answer:

Title page should be the first page of a report.

hope it helps!

6 0
3 years ago
Why is a Quality assurance tester needed on a software development team?
arsen [322]

Answer:

Quality assurance testing plays a very crucial role in the process of software development. It saves money and time by spotting bugs and errors early in the software development life-cycle. Software that is newly developed may have inconsistencies, redundancies, and flaws; therefore, proper QA testing is mandatory.

Explanation:

3 0
3 years ago
What is a nonlinear presentation?
TEA [102]
The answer is A. For example, you could start at slide 8 and jump to slide 2 and then to 3. It does not follow and linear structure!!
8 0
3 years ago
Read 2 more answers
Which tab on the ribbon houses the sort functions?<br><br> Insert<br> Data<br> View<br> Home
irinina [24]

Answer:

data

Explanation:

got it right on edgenuity

6 0
3 years ago
The programming interface for a legacy motor controller accepts commands as binary strings of variable lengths.
victus00 [196]

Answer:

The answer is "Option a"

Explanation:

The given question is incomplete, that's why its correct solution can be defined as follows:

The above-given question is the part of the Binary Autocomplete, in which this Autocomplete function would be a full word or sentence after just a few other letters were entered into the system. It approach improves text taking appropriate on smartphone devices of particular because every letter should not be written in such a single phrase.  

3 0
3 years ago
Other questions:
  • give two main reasons that should be considered when preparing and deploying a functional restoral scenario.
    5·1 answer
  • Click _______ to view each individual record of a mail merge document.
    5·2 answers
  • Which of the following jobs is considered part of the information technology industry?
    15·2 answers
  • ________ is a model of computing in computer processing, storage, software, and other services which are provided as a shared po
    9·1 answer
  • Write a statement that toggles the value of the bool variable onoffswitch. that is, if onoffswitch is false , its value is chang
    10·1 answer
  • For which type of long-distance call do you need to tell the operator the name of the person to whom you wish to speak?
    10·1 answer
  • which of the following memory types cannot store the data for information permanently Ram chachi Flash Memory hard disk​
    8·1 answer
  • Write the definition of a function reverse, whose first parameter is an array of integers and whose second parameter is the numb
    15·1 answer
  • Most 4 year colleges want an applicant's scores for all the following except
    12·1 answer
  • Please answer that and i'll gave you branlliest
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!