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
Leona [35]
3 years ago
14

Write a program that will print out statistics for eight coin tosses. The user will input either an "h" for heads or a "t" for t

ails for the eight tosses. The program will then print out the total number and percentages of heads and tails. Use the increment operator to increment the number of tosses as each toss is input. For example, a possible sample dialog might be: For each coin toss enter either ‘h’ for heads or ‘t’ for tails. First toss: h Second toss: t Third toss: t Fourth toss: h Fifth toss: t Sixth toss: h Seventh toss: t Eighth toss: t Number of heads: 3 Number of tails: 5 Percent heads: 37.5 Percent tails: 62.5
Computers and Technology
1 answer:
shusha [124]3 years ago
3 0

Answer:

Written in Python

head = 0

tail = 0

for i in range(1,9):

     print("Toss "+str(i)+": ")

     toss = input()

     if(toss == 'h'):

           head = head + 1

     else:

           tail = tail + 1

print("Number of head: "+str(head))

print("Number of tail: "+str(tail))

print("Percent head: "+str(head * 100/8))

print("Percent tail: "+str(tail * 100/8))

Explanation:

The next two lines initialize head and tail to 0, respectively

head = 0

tail = 0

The following is an iteration for 1 to 8

<em>for i in range(1,9): </em>

<em>      print("Toss "+str(i)+": ") </em>

<em>      toss = input()  </em><em>This line gets user input</em>

<em>      if(toss == 'h'):  </em><em>This line checks if input is h</em>

<em>            head = head + 1 </em>

<em>      else:  </em><em>This line checks otherwise</em>

<em>            tail = tail + 1 </em>

The next two lines print the number of heads and tails respectively

print("Number of head: "+str(head))

print("Number of tail: "+str(tail))

The next two lines print the percentage of heads and tails respectively

print("Percent head: "+str(head * 100/8))

print("Percent tail: "+str(tail * 100/8))

You might be interested in
An alternative to configuring individual workstations is to establish configurations dynamically when the computers connect to t
Lapatulllka [165]

Answer:

come help me on my last question please

Explanation:

6 0
3 years ago
Write a police description a person who know you well​
SIZIF [17.4K]

Answer:

I will be describing Jude. He is a neighbor.

Explanation:

A police description refers to the method of describing a person using high-level detailing. An example is given below:

  1. He is a Five feet-three male caucasian
  2. With brown eyes and
  3. an Australian accent
  4. He has a military haircut
  5. About 38 years
  6. Weighs about 95Kg
  7. and dresses casually
  8. he walks with a slant to the left
  9. a dove tattoed at the back of his neck
  10. and a birthmark on his left ear lobe

Cheers

3 0
3 years ago
I NEED HELP QUICK
Serjik [45]

Answer: keeps confidential documents secure,

displays a GUI, allocates the computer's resources, and retrieves files

Explanation:

The operating system can be defined as the software installed in the system that provides the information and services to the users by controlling the hardware, software resources, and regulates the computer programs. It runs the applications and programs in the system, displays the graphic user interface for the services, stores, manipulates, and retrieves files. It prevents the unauthorized access to the data and programs by using passwords thus provides the security to the system and documents.

8 0
2 years ago
A ___________ allows Internet telephony service providers to deliver telephony services and unified communications applications
Firlakuza [10]

Answer: SIP Trunk

Explanation:

   The SIP is stand for the session initiation protocol trunk is one of the service that is specifically provided by the service provider and the main purpose of the SIP trucking is to manage the VoIP call process (Voice over IP).

According to the given question, SIP is one of the protocol that allow telephony services for the communication purpose and it also offer the video, Message, media and the voice application and these process are control by using this type of technology.  

 Therefore, SIP Truck is the correct answer.  

8 0
3 years ago
Identity theft, where people steal personal information, continues to be a problem for consumers and businesses. Assume that you
svetlana [45]

Answer:

Secure the personal information with complex multi-factor authentication and configure intrusion detection and prevention and a firewall.

Explanation:

Multi-factor authentication is a method of securing a client's personal information from the client's side to the data centre. It uses more than one security processes not policies. There key be three authentications process like a password, security token and biometrics or two authentications like password and biometrics or token.

The firewall and intrusion detection and prevention are vulnerability preventive method to detect and stop cyber attacks.

5 0
3 years ago
Other questions:
  • Do most facebook and twitter users access the platform from their personal computers?
    6·2 answers
  • Which of the following typically have the highest auto insurance premiums?
    14·1 answer
  • Which of the following about if statement is true? A. The condition is a Boolean expression B. A Boolean expression is something
    15·1 answer
  • (I made this up teehee) what anime is katski bakugo from
    15·2 answers
  • The worlds two highest dams are both in tajikistan. the rogun dam is 35 meters taller than the nurek dam. together they are 635
    13·1 answer
  • Which of the following lists the proper order of the categories of the SOC system from general to specific?
    11·1 answer
  • Primary functions of lighting are sufficient light to...
    13·1 answer
  • How can you remove background noise from a video?
    15·2 answers
  • Suppose that a particular algorithm has time complexity T(n) = 3 \times 2^nT(n)=3×2 ​n ​​ and that executing an implementation o
    14·1 answer
  • Hi. I'm a beginner in python. Can anyone tell me what I'm missing or doing wrong, because I can't figure out why my messages in
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!