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
Alenkasestr [34]
3 years ago
12

Modify your previous exercise to determine if the user can ride a rollercoaster. To ride the rollercoaster, you must be at least

42 inches tall. You must also be at least 9 years old. Ask the user how tall and how old they are. Use ONE if-else to determine if the user can ride the rollercoaster. Note how much cleaner this is and how much less repetition this method has.
Computers and Technology
1 answer:
sweet-ann [11.9K]3 years ago
4 0

Answer:

In Python:

age = int(input("How old are you? "))

height = float(input("How tall are you (inches)? "))

if age>=9 and height >= 42:

    print("You can ride the roller coaster")

else:

    print("You ca'nt ride the roller coaster")

Explanation:

The code segment of the "previous exercise" is not given; so, I rewrite the program from scratch using python.

And using the solution I provided, you'll have an idea of how to write the expected code If the "previous exercise" is not written in python,

This line prompts user for age

age = int(input("How old are you? "))

This line prompts user for height

height = float(input("How tall are you (inches)? "))

This checks if user is at least 9 years old and at least 42 inches tall

if age>=9 and height >= 42:

If true, the user gets to ride the roller coaster

    print("You can ride the roller coaster")

else:

If otherwise, the user will not ride the roller coaster

    print("You ca'nt ride the roller coaster")

You might be interested in
How frequently should computers containing ehr information be backed up?
geniusboy [140]
Explain what is meant by a limited data set and how this HIPAA rule may affect medical assistants
7 0
3 years ago
You are writing an email to a potentional employer about a job opportunity. What can you do to make sure the email reflects your
Lina20 [59]
You want to use proper etiquette and be polite, do not call them by their first name and always refer to them as Mr., or Mrs. Use an extended vocabulary and do not talk about yourself.  If you have proper grammar, depending on the job, that can be seen as intelligence. And always use an appropriate closing that is respectful. Such as, Sincerely, John Doe.
4 0
3 years ago
Read 2 more answers
I need help please?!!!!
mrs_skeptik [129]
It would be wear a seatbelt
6 0
3 years ago
Read 2 more answers
Suppose we want to compress a text consisting of 6 characters,a, b, c, d, e, fusingthe Huffman Algorithm. Give an example for wh
denis-greek [22]

Answer:

Check the explanation

Explanation:

When it comes to the field of computer science and information theory, the Huffman code is a specific type of optimal prefix code that is mostly utilized for the compression of lossless data. The process and procedures of finding or using such a code proceeds by means of Huffman coding, which is an algorithm that was developed by David A.

kindly check the below image for the complete answer to your question.

8 0
3 years ago
How do you print "Hello World" in the console with Python? Wrong Answers Only.
Nata [24]

Explanation:

with keyboard........

4 0
3 years ago
Read 2 more answers
Other questions:
  • Jeremy Bridges is an executive for Green Web Designs, where his primary role is to ensure the security of business systems and d
    6·1 answer
  • Some technologies like vertical farming have a number of negative effects. Which is a negative outcome of this technology? A. In
    10·1 answer
  • Your sister wants to purchase Microsoft Office 2013 for her new laptop. She doesn't want to pay for a subscription, and she want
    12·1 answer
  • Do you think that distributed OSs use a process-communication technique different from that used by desktop OSs?
    13·1 answer
  • 6. Choose the TWO conditions that could be used for an IF-statement, without a compile-time error. Assume variable str is a Stri
    13·1 answer
  • How was the addition of an improvement over early web design?
    11·1 answer
  • What's wrong with these codes in code HS Karel challenges(7.1.2. Racing Karel) Codes: //Below is the program that have Karel mov
    13·1 answer
  • Which of the following expressions yields an integer between 0 and 100, inclusive? Question 5 options: (int)(Math.random() * 100
    6·1 answer
  • Write a description of the photograph to someone who cannot see the photograph. Be sure to include the title of the photograph a
    5·1 answer
  • Q1). Write a python program to pass a list to a function and double the odd values and half even values of a list and display li
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!