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
lutik1710 [3]
4 years ago
12

Write a function so that the main program below can be replaced by the simpler code that calls function mph_and_minutes_to_miles

(). Original main program: miles_per_hour = float(input()) minutes_traveled = float(input()) hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('Miles: {:f}'.format(miles_traveled))

Computers and Technology
2 answers:
Hatshy [7]4 years ago
7 0

Answer:

Check the explanation

Explanation:

Solution(Simplified main code):

# Function written to simplify main code

def mph_and_minutes_to_miles(miles_per_hour, minutes_traveled):

   hours_traveled = minutes_traveled / 60.0

   miles_traveled = hours_traveled * miles_per_hour

   return miles_traveled

miles_per_hour = float(input())

minutes_traveled = float(input())

print('Miles: %f' % mph_and_minutes_to_miles(miles_per_hour, minutes_traveled))

Kindly check the attached image below for the code screenshot and output.

AveGali [126]4 years ago
4 0

Answer:

def mph_and_minutes_to_miles():

   miles_per_hour = float(input())

   minutes_traveled = float(input())

   hours_traveled = minutes_traveled / 60.0

   miles_traveled = hours_traveled * miles_per_hour

   print('Miles: {:f}'.format(miles_traveled))

mph_and_minutes_to_miles()

Explanation:

Create a function called mph_and_minutes_to_miles that takes no parameter

Get the code from the main part and put them inside the function

Call the function as requested

You might be interested in
The term that refers to the standard computer language for creating web pages is called:
Pavel [41]

Answer:

Language programming Web's programming language

Explanation:

6 0
4 years ago
What is the ghosted text or picture behind the content on the page?​
Svetach [21]

Answer:

Watermark

Explanation:

This is actually called a Watermark. It is usually used as a way of showing the name or logo of the author who owns the content that is underneath the watermark. This is done so that individuals cannot steal the owner's work and use it as their own. Usually, the owner has the original version of the content without any watermark, as well as individuals that have purchased the content or a licence to use the content for personal or commercial usage.

3 0
3 years ago
Pig Latin is ______ and fits very naturally in the pipeline paradigm while SQL is instead declarative.
alisha [4.7K]

Answer:

Option b) is correct

Explanation:

Pig Latin is a language game in which English words are altered either by adding a suffix or such kind of suffix can be created by adding a syllable (vocalic). For example, ''hello'' becomes ''ello-hay''.

Pig Latin is <u>procedural</u> and fits very naturally in the pipeline paradigm while SQL is instead declarative.

3 0
3 years ago
Bob flys a drone which has a 20 megapixel camera attached, what is the definition of "megapixel in this context? Why does it mat
Verizon [17]

Answer:

megapixel refers to the unit of resolution i.e. one million

Explanation:

Interestingly the higher the pixels does not mean higher quality of image, it's more about the camera and it's sensor.

I am a photographer and a licensed drone pilot and have researched the subject to help with camera choice, both DSLR and drone.

5 0
3 years ago
QUESTION 4 of 10: True or False: According to the reading, investors care about your love for your business.
mixer [17]

Answer:

false

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Why were mechanical calculators developed?
    8·2 answers
  • ) Suppose algorithm A takes 10 seconds to handle a data set of 1000 records. Suppose the algorithm A is of complexity O(n2). Ans
    12·1 answer
  • What can act as a buffer against unemployment
    11·1 answer
  • What should be done with statements or sections which are unclear?
    12·2 answers
  • How do I start conversations with ppl??? If u answer right I will try send u more points... So please help me
    7·1 answer
  • Which company was the first to develop personal computers?
    6·1 answer
  • The analogy of a computer system is often used to illustrate the different parts of memory. The keyboard is where we encode new
    8·1 answer
  • This code --&gt; plt.plot(x,y) is used to draw :
    8·1 answer
  • Heeeeeeeeeeeeeeeeeeeeeeeeelp pat.2
    12·1 answer
  • Which type of attack can be addressed using a switched ethernet gateway and software on every host on your network that makes su
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!