answer.
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]
2 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]2 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
Steps in creating a folder
enyata [817]
Right click computer screen and press new folder?
or add paper to rings in the physical folder<span />
8 0
1 year ago
Janeal spends her day looking at the stock and bond markets and evaluating how the portfolios of the businesses she serves will
pychu [463]

Answer:

ur answer good sir will be : financial analyst

and a brainliest will be good to thnx

4 0
2 years ago
If the input is negative, make numItemsPointer be null. Otherwise, make numItemsPointer point to numItems and multiply the value
Brilliant_brown [7]

Answer:

The code for the given statements are described below.

Explanation:

// Place code below in line 9

if(numItems < 0)  // starting of a loop

{

numItemsPointer = NULL;

}

else  

{

numItemsPointer = &numItems;

numItems = numItems * 10;   // items multiplied by 10

}   // ending of a loop

6 0
2 years ago
Sara is using her personal laptop (which is password protected) at a "hotspot" at a local cafe with wifi access. She is in the m
Ymorist [56]

Answer:

C) Exit all programs and shut down the compute

Explanation:

4 0
1 year ago
Janice is unsure about her future career path she has grown up on her family farm but she is also interested in medicine Janice
KiRa [710]
Janice can actually used both knowledge as an advantage. She can use her background in farming while learning more about medicine. In such a way, she can have a strong advantage in medicinal farming - like learn ways to create good and effective drugs from plants, etc. 
5 0
1 year ago
Other questions:
  • Raj needs to apply sorting to a current list in his Word document.
    11·2 answers
  • Write a client program that writes a struct with a privateFIFO name (call it FIFO_XXXX, where XXXX is the pid that you got from
    11·1 answer
  • A restaurant has a case type that allows customer to book the dining room for events. Customers provide basic information includ
    11·1 answer
  • python Write a function that computes a future investment value at a given interest rate for a specified number of years. The fu
    11·1 answer
  • How is the IT function organized in your school or place of employment? Create an organization chart showing how the IT organiza
    7·1 answer
  • The variable grade can have any real number value from 0 to 100. Ask the user to enter a grade in numerical form. Write an if-el
    9·1 answer
  • Complete the program below that takes in one positive, odd, integer, n (at least 3), and prints a "diamond" shape of stars with
    9·1 answer
  • A mobile device user has tried to install a new app numerous times without success. She has closed all unused apps, disabled liv
    7·1 answer
  • [20 points] 3.3 Code Practice: Question 2
    7·1 answer
  • In Python, parentheses are used in calculations where the order of operations affects the outcome. (5 points)
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!