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
enot [183]
3 years ago
7

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' % miles_traveled) Sample output with inputs: 70.0 100.0 Miles: 116.666667
Computers and Technology
1 answer:
Blababa [14]3 years ago
4 0

Answer:

Here is  code in python .

#function to calculate miles traveled

# pass two parameter in the function "miles_per_hour" and "minutes_traveled"

def mph_and_minutes_to_miles(miles_per_hour, minutes_traveled):

# convert minutes to hours

   hours_traveled = minutes_traveled / 60.0

   #calculate total miles traveled

   miles_traveled = hours_traveled * miles_per_hour

   #return the value

   return miles_traveled

#read input from user

miles_per_hour = float(input())

minutes_traveled = float(input())

#call the function and print the output

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

Explanation:

Read the value of "miles_per_hour" and "minutes_traveled" from user. call the function mph_and_minutes_to_miles() with those two parameters.calculate total hours from the minutes_traveled by dividing it with 60. then calculate the total miles by multiply hours_traveled * miles_per_hour. then return the miles travelled.

Output:

20                                                                                                                        

150                                                                                                                        

Miles: 50.000000

You might be interested in
Are one of the greatest features of Photoshop that allow nondestructive editing of images.
ioda

Answer:

The answer is explained below

Explanation:

They are many features in photoshop that allow for nondestructive editing of images, these are:

  1. Dialog box: It also for the user to undo an activity to the last change
  2. Layer: It contain data that can be adjusted to change the appearance of an image.
  3. Mask: It protect a designated portion from changes you want to make.
  4. Smart Objects: It allows for the editing of an image without altering or damaging the original image
  5. Revert: It allows you to go back to the original image as it was when you opened the document.
  6. Crop: After cropping an image you can choose to hide the cropped part instead of deleting it.
7 0
3 years ago
If an occupation is projected to grow by 13% over the next 10 years, how would you rate the job outlook?
Elena L [17]

Answer:

Steady

Explanation:

Its not an insane growth rate but it would more then likely be Steady.

6 0
3 years ago
Read 2 more answers
Which layer of the osi model defines functions related to data delivery, error recovery, and flow control?
Dominik [7]
Answer is the Transport Layer.
5 0
3 years ago
Which of the following is an accurate statement? When the LOWER function is used in a SELECT clause, it will automatically store
quester [9]

Answer:

Hi there! The answer is C:

Explanation:

The scope of the LOWER function is limited to the select clause it is being used in. Outside of the select statement, the column will be returned as it is currently present in the database. Using the LOWER function will not automatically store data in lower case letters in the database tables. As an exercise, try creating a simple database table called "Employees" with columns "id" and "name". Then input a row using an insert statement with id as 1 and name as "BLAH". Try using the select statement with LOWER function and then without the LOWER statement.

5 0
3 years ago
with the _______ network topology, reliability is the major advantage while high cost is the disadvantage.
Nady [450]
It's what the chat says, Its hybrid
6 0
3 years ago
Read 2 more answers
Other questions:
  • What is the output after the following code executes?
    14·1 answer
  • The ____ file permission category in unix/linux systems typically entails all permissions and is designated by the letter u.
    7·1 answer
  • Why should you delete files from your computer? (multiple answers can be chosen)
    5·2 answers
  • a corporation needs an operating system that allows the various teams in its office to network & collaborate on projects. wh
    11·2 answers
  • The simplest method to copy information is to first select the information you want to copy, and then use the Copy button and th
    11·1 answer
  • Charlie wants you to include the following topics in your presntation: an overview of project management and its hrity,a descrip
    15·1 answer
  • . A wireless ……..is a device used to resolvewireless network connectivity problems.
    8·1 answer
  • What is one effective way for employees to keep their skillsets current?
    8·2 answers
  • If cell G7 contains the function ________, it states that if the value in cell C3 is 9, the number 7 will be assigned to cell G7
    6·1 answer
  • Which native windows application allows you to access basic pc settings and controls such as system information, controlling use
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!