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
An operating system is defined as hardware that converts software into a useful form for applications.
marissa [1.9K]

Hardware that transforms software into a form that is helpful for applications is referred to as an operating system. False. Hardware conversion is done by software.

<h3>What is an operating system?</h3>
  • Computer hardware and software resources are managed by an operating system (OS), which also offers common functions for software programs.
  • Operating systems that use time-sharing plan activities to make the most of the system's resources.
  • They may also contain accounting software to allocate costs for processing time, mass storage, printing, and other resources.
  • An operating system (OS) is a piece of software that controls all of the other application programs in a computer after being originally loaded by a boot program.
  • Through a specified application program interface, the application programs seek services from the operating system (API).

To learn more about operating system, refer to:

brainly.com/question/22811693

#SPJ4

4 0
1 year ago
What is the value of 8n when n= = 2?​
lidiya [134]

Answer:

The value of 8n would be 16

8n

8(2)= 16

(uhh this is a math question right? Sorry if it has to deal with tech)

6 0
3 years ago
Edward has started up a new company with his friend, Matthew. Currently, he has only two people working with him. Which type of
Kruka [31]

A Peer-to-peer network architecture would work best for Edward and Matthew.

Although they have the option of creating a Client-Server type of network architecture, the number of people that they are currently working with would cost them a lot more than a peer-to-peer architecture.

One of the advantages of using a Peer-to-peer network architecture for a small network would be the access of files between all computers in the network. Even if one of the computers will fail, the other computers will still have access to the different files and information they will need to keep the company moving forward.

6 0
3 years ago
Which of the following shows a list of Big-Oh running times in order from slowest to fastest?
Rufina [12.5K]

Answer:

O(N!), O(2N), O(N2), O(N), O(logN)

Explanation:

N! grows faster than any exponential functions, leave alone polynomials and logarithm. so O( N! ) would be slowest.

2^N would be bigger than N². Any exponential functions are slower than polynomial. So O( 2^N ) is next slowest.

Rest of them should be easier.

N² is slower than N and N is slower than logN as you can check in a graphing calculator.

NOTE: It is just nitpick but big-Oh is not necessary about speed / running time ( many programmers treat it like that anyway ) but rather how the time taken for an algorithm increase as the size of the input increases. Subtle difference.

5 0
2 years ago
Read 2 more answers
Match the vocabulary to the appropriate definition.
Allisa [31]

Answer:

Pulling related code together in objects is Arrays

Helps programmers when they revisit code or are new to code-- Documentation

Explanation:

This is all I know

3 0
2 years ago
Other questions:
  • Under what key category do page up and page down keys fall?
    15·1 answer
  • To begin importing data from an excel spreadsheet, click on the ____ tab on the ribbon.
    11·1 answer
  • If you want to be more efficient at using the World Wide Web, refresh the page often.
    7·1 answer
  • What does the rule of five say?
    12·2 answers
  • Advantages of purchasing a software package over developing software in-house include all of the following except ____. Group of
    13·1 answer
  • A variation of pronounce is a. Proclaim c. Produce b. Profound d. Pronunciation Please select the best answer from the choices p
    11·1 answer
  • When a formula contains the address of a cell, it is called a(n) ________.
    15·1 answer
  • Theodor is researching computer programming. He thinks that this career has a great employment outlook, so he'd like to learn if
    9·2 answers
  • The executive ________ is the person ultimately responsible to their company for the project's success.
    13·1 answer
  • Who designed the apple i computer in 1976?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!