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]
2 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]2 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
2. Student organizations sometimes require transportation for off-campus activities, and school policy requires students to be o
Dafna11 [192]

Answer:

=IF(B2>=23,"Yes","No")

Explanation:

Given

Name = Kay Colbert

The Name column can't be used to determine the eligibility of a student to the transport.

What is needed is the corresponding age column of Kay's age.

Assume that the age column is B2 and the result column is C2 (See Attachment)

Enter the following in C2

=IF(B2>=23,"Yes","No")

This will return "Yes" without the quotes in cell C2 if B2 is greater than 23

Else, it'll return "No" without the quotes.

To drag the formula to other column, follow the instructions below

Select cell C2.

Rest your cursor in the lower-right corner so that it turns into a plus sign (+), like this:

Drag the fill handle downwards

3 0
3 years ago
Which slot type would you install a video card in to get the best performance?
erma4kov [3.2K]
It really is hard to say because there are many slots and we do not know what your teacher is teaching. I have seen a lot of teachers teaching out of date material. With that said, here is a list from best to worst.

PCI Express x16
PCI Express x1
AGP
PCI

This is list is based on greatest to least and base on the bandwidth read and write speed.

6 0
3 years ago
1. Describe the sequencing of factors influencing health status codes for patients that also have chronic conditions being manag
Vesnalui [34]
Bubyggyy tvtvtvttfrcrt
4 0
3 years ago
A group known as ""Takedown"" hacked into your political action committee website and defaced it. Which type of threat actor is
natima [27]
<h2>Answer:</h2><h3>Hacktivist group is most likely to responsible for this.</h3><h3 /><h2>Explanation:</h2>

Hacktivism is defined as an action in which a computer or a network is targeted so that it could be misused in order to achieve a goal against any social or political action.

Hacktivists are the persons who perform hacktivism in order to seek attention on a specific thing or issue they want, from all the people.

In the given scenario, the hacking attack is hactivism as it is done to pull the company down.

Hacktivist can be a single person as well as a group of people working together. However they try to work anonymously so that they could not be traced.

<h3>I hope it will help you! </h3>
6 0
3 years ago
Select the correct text in the passage.
oksian1 [2.3K]

Answer:

Answer is given below

Explanation:

The index of the smallest value returned by function positionMin(),

and it is done by line "return minPosition;"

The input array is given as an argument in function selSort() and it is done by line "public static void selSort(int [] vals)" Here vals is input array argument.

6 0
3 years ago
Other questions:
  • Which key removes all data from an active cell with one click
    7·2 answers
  • Which type of communication is usually handwriten
    11·2 answers
  • what is the primary way to access applications in windows 8? a. control panel b. start menu c. desktop tiles d. context menu
    7·1 answer
  • Create a button to play the playlist <br><br> Java, netbeans
    7·2 answers
  • All of the following are eras in IT infrastructure evolution except the​ ________. A. general purpose mainframe and​ mini-comput
    12·1 answer
  • Among the eight unique features of​ e-commerce, which is related to the ability to interact with web technology​ everywhere?
    14·1 answer
  • A data flow cannot go directly back to the same process it leaves. There must be at least ________ other process(es) that handle
    15·1 answer
  • The purpose of the 3030 gas dehydration unit
    11·1 answer
  • Select the correct answer.
    5·2 answers
  • 56- What is the term used when you press and hold the left mouse key and more the mouse
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!