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]
4 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]4 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
Nina is explaining the SQA process to her friend Amanda.
Nezavi [6.7K]
<span>B. Plan
</span><span>C. Planning
yes or no</span>
4 0
3 years ago
Peter took a selfie in his room. He was a wearing a light blue shirt. But he failed to realize that that shirt would clash in co
Leto [7]

Answer:

A wand tool is to do that in an editing software.

7 0
3 years ago
Read 2 more answers
Namespaces cannot have namespaces as members.<br><br> True<br><br> False
Anna71 [15]

Answer:

False

Explanation:

namespaces can be nested. That is we can have a hierarchy of namespaces.

For examples suppose we have a namespace top. Within this we have another namespace first. At the next level we have a namespace called second. Then we have a class MyClass as a member of this namespace second. Then the complete description of the class will be as follows:

top::first::second::MyClass

5 0
4 years ago
Which of these are variables in an organization? Choose three.
Rzqust [24]

Answer:

Example of organizational variables are codes of ethics, ethical climate, organizational size, top management, organizational structure and organization culture.

Explanation:

Organizational variables can be defined as characteristics of a decision that influences the decision-making process and its outcome. This organizational variables also influence how an individual makes decisions.

Example of organizational variables are codes of ethics, ethical climate, organizational size, top management, organizational structure and organization culture.

6 0
3 years ago
Which of these is NOT an advantage of the impact of computer careers.
nikdorinn [45]
I believe the answer could be the first choice. I'm not quite sure, though
4 0
3 years ago
Read 2 more answers
Other questions:
  • What is displayed in the alert dialog box after the following code is executed? var items = 3; for (var i = 1; i &lt;= items; i+
    8·1 answer
  • The work principle is not always true<br> T or F
    11·2 answers
  • How much Continents Arctic Ocean that touches
    5·2 answers
  • Select the appropriate APA guidelines when typing a research paper.
    11·1 answer
  • What other kinds of toolbars exist in addition to those that are part of individual programs?
    10·1 answer
  • Which of the following is NOT a safety practice for working near power lines?
    14·1 answer
  • Why is failure an important part of life and the engineering design process?
    13·2 answers
  • 1. Pasar los siguientes ejercicios a diagrama de bloque
    11·1 answer
  • Can someone be my friend,don't friend me until i ask you Questions
    14·1 answer
  • How to view average for an assignment in gradebook in canvas.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!