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
Conceptos importantes de red de computadoras
Bumek [7]

Answer:

-Consiste en conectar varias redes de computadoras basadas en diferentes protocolos -Requiere la definición de un protocolo de interconexión común sobre los protocolos locales. -El Protocolo de Internet (IP) desempeña este papel, definiendo direcciones únicas para una red y una máquina host.

3 0
3 years ago
Assignment 2: Room area
Y_Kistochka [10]

Answer:

a = float(input("Enter Side A: "))

b = float(input("Enter Side B: "))

c = float(input("Enter Side C: "))

d = float(input("Enter Side D: "))

e = float(input("Enter Side E: "))

area1 = 1.0* a * b

area2 = (a - c) * (d - e -b)

area3 = 0.5 * (a - c) * e

print ("Room Area: " + str(area1 + area2 + area3))

Explanation:

happy to help ^3^

5 0
3 years ago
Assume you have a packet with data payload of 1024 bytes. The packet header is 6 bytes. Assume there is no other overhead. The c
Sveta_85 [38]

Answer:

PER= 0.824

Explanation:

Total bytes = 1024+6

=1030 bytes

=1030*8 bits

= 8240 bits

BER = 0.0001

Packet Level Error (PER) = 8240*0.0001

= 0.824

7 0
3 years ago
Which of the following is among the ComScore Ad Metrix Reports?
IceJOKER [234]
I think it is d but not exactly sure
6 0
2 years ago
A _____ is a computer virus that replicates and spreads itself, not only from file to file, but from computer to computer via e-
SOVA2 [1]
Trojan horse
....................
6 0
3 years ago
Other questions:
  • What is the difference between chrome and chromium browser?
    9·1 answer
  • Allie needs to add a long row of numbers. She should enter a
    13·2 answers
  • Which are the benefits of leveraging web technologies?
    8·2 answers
  • Instagram
    9·1 answer
  • Problem 5. (Greatest Common Divisor) Write a program gcd.py that accepts p (int) and q (int) as command-line arguments, and writ
    13·1 answer
  • How much RAM memory is recommended for your computer to be used as a digital darkroom?
    9·1 answer
  • What do you think is the most fascinating aspect of the internet?
    7·2 answers
  • 75+ (43-54)<br> -12<br> 12<br> 41
    12·2 answers
  • Write program to read 10 random numbers, then find how many of them accept division by 4,
    6·1 answer
  • The development of online capabilities created the ________, an information- and communication-based electronic exchange environ
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!