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
Do applications need to exchange udp control messages before exchanging data
Molodets [167]

The answer is NO.

Thats what makes UDP connectionless. Aclient that is going to send a UDP message to the server just sends it.The server does not know it is coming untill it arrives .When a server recieves a UDP message it gets the source address/port and the data.

7 0
3 years ago
Which of the following is the most appropriate wireless technology for real-time location of caregivers and mobile equipment in
Gekata [30.6K]
Wi-Fi is the anwser.Hope I helped.
7 0
2 years ago
Name the types of computer used in hospital for computer​
disa [49]

Answer: These are all the computers they use All.

All In One Computers.

Medical Grade Computers.

Medical Tablets.

Medical Box PCs.

Medical Box PCs.

Displays & Monitors.

Medical Grade Monitors.

5 0
3 years ago
Write the definition of a function named printpoweroftwostars that receives a non-negative integer n and prints a line consistin
Aleksandr-060686 [28]
To accomplish this without using a loop,
we can use math on a string.

Example:
print("apple" * 8)

Output:
appleappleappleappleappleappleappleapple

In this example,
the multiplication by 8 actually creates 8 copies of the string.

So that's the type of logic we want to apply to our problem.

<span>def powersOfTwo(number):
if number >= 0:
return print("*" * 2**number)
else:
<span>return

Hmm I can't make indentations in this box,
so it's doesn't format correctly.
Hopefully you get the idea though.

We're taking the string containing an asterisk and copying it 2^(number) times.

Beyond that you will need to call the function below.
Test it with some different values.

powersOfTwo(4) should print 2^4 asterisks: ****************</span></span>
4 0
3 years ago
Imagine that you are helping a customer needing technical assistance for a printer they recently purchased. They bought the prin
Lisa [10]
If you happen to meet that kind of problem, the most appropriate series of steps to take in troubleshooting the issue is that first, are there steps that i haven't done? If there's no power even if it is plugged in, try to check the wire. Look for a different wire cable and connect it to your printer. If it still does not work, then check it over to the service center.
3 0
3 years ago
Read 2 more answers
Other questions:
  • What are Three types of informational references
    9·2 answers
  • Which directory holds most of the system log files?
    8·1 answer
  • Suppose you want to delete an existing file from within Word. What would you do? A. Click on the File button, choose Recent, ope
    9·1 answer
  • The "fathers of the internet" are vinton cerf and ________.
    9·1 answer
  • Which of the following words is an anatomy for cautious
    14·1 answer
  • Let’s define a new language called dog-ish. A word is in the lan- guage dog-ish if the word contains the letters ’d’, ’o’, ’g’ a
    6·1 answer
  • You want to establish the validity of a test designed for computer technicians using a predictive criterion-related validation s
    9·1 answer
  • HELP ASAP!Select all examples of desirable workplace skills, habits, and attitudes.
    7·1 answer
  • What will be the range of the random numbers generated by the following code snippet? rand() % 50 + 5;
    14·1 answer
  • Anyone have any website ideas I could use for my computing website project? Thank you.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!