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
ira [324]
3 years ago
14

Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is

either heads or tails. Assume the input is a value greater than 0.
Computers and Technology
1 answer:
Nataly [62]3 years ago
7 0

Answer:

import random

decisions = int(input("How many decisions: "))

for i in range(decisions):

   number = random.randint(0, 1)

   if number == 0:

       print("heads")

   else:

       print("tails")

Explanation:

*The code is in Python.

import the random to be able to generate random numbers

Ask the user to enter the number of decisions

Create a for loop that iterates number of decisions times. For each round; generate a number between 0 and 1 using the randint() method. Check the number. If it is equal to 0, print "heads". Otherwise, print "tails"

You might be interested in
What science category includes physics and biology?
enyata [817]

Answer:

Physical science is the study of the inorganic world. That is, it does not study living things. (Those are studied in biological, or life, science.) The four main branches of physical science are astronomy, physics, chemistry, and the Earth sciences, which include meteorology and geology.

5 0
2 years ago
How do u get rid of this (the grey box)
slamgirl [31]

Answer:

can't helpnyounddjdjzjzjsjejs jvm d

8 0
3 years ago
Read 2 more answers
Select all that apply. To select more than one worksheet at the same time, which of the following keys on your keyboard can you
Colt1911 [192]
<em>Shift </em>selects multiple worksheets at the same time. <em>Ctrl</em> selects all that you selected with Ctrl pressed.
4 0
3 years ago
What the meaning of ethics
insens350 [35]
Ethics is a system of moral principles and is concerned with what is good for individuals and society and is also described as moral philosophy.
3 0
2 years ago
Employees at the Red Bluff Golf Club &amp; Pro Shop have the opportunity to become certified trainers if they log enough hours.
vodka [1.7K]

Answer:

Following are the solution to this question:

Explanation:

Some of the data is missing in the question, which is defined in the attached file. Please find it.

Follows are the formula which is used in the question:

  • EmployeeAnalysis Worksheet IF(C5>49,"Certified","Not Certified")
  • Transactions Worksheet IF(F10="No","",0.07)

In the first condition, it checks "C5" is greater than 49 if the condition is true, it will give "Certified" otherwise, it will give "Not Certified".

In the second condition, it checks "F10" is equal to "No" if the condition is true, it will give a blank or space otherwise, it will give "0.07".

3 0
2 years ago
Other questions:
  • Need help this will affect my final grade in technology and the dead line has passed!!!
    11·1 answer
  • Write a program reverse-order.cpp which asks the user to input two dates (earlier date then later date). The program should repo
    13·1 answer
  • Assume the following variable definitions int a = 5, b = 12; double x = 3.4, z = 9.1. What are the values of the following expre
    7·1 answer
  • What question should you ask yourself to determine if a story is newsworthy
    11·2 answers
  • What are the types of hypervisiors ?
    5·2 answers
  • Convert the following pseudocode to C++ code. Be sure to define the appropriate variables. Store 25 in the speed variable. Store
    5·1 answer
  • Which of the following statements is correct?
    11·1 answer
  • Whitch event describes a festival in rio, brazil that includes a samba parade and eccentric outfits?
    13·1 answer
  • Read each statement below. If the statement describes a peer-to-peer network, put a P next to it. If the statement describes a s
    12·1 answer
  • GIF is example of raster image<br><br><br> RIGHT OR WRONG?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!