answer.
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
yKpoI14uk [10]
2 years ago
5

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.0miles_traveled = hours_traveled * miles_per_hourprint('Miles: %f' % miles_traveled)Sample output with inputs: 70.0 100.0Miles: 116.666667

Computers and Technology
1 answer:
Ksivusya [100]2 years ago
6 0

Answer:

def mph_and_minutes_to_miles(hours_traveled,miles_traveled ):

   hours_traveled = minutes_traveled / 60

   miles_traveled = hours_traveled * miles_per_hour

   print('Miles: %f' % miles_traveled)

Explanation:

Using Python programming language. The function is given above specifying two positional arguments (hours_traveled,miles_traveled)

In the main function, the user is prompted for inputs, the method is called and the user's input is passed as parameters. See complete code and output attached

You might be interested in
The elements of an integer-valued array can be set to 0 (i.e., the array can be cleared) recursively as follows: An array of siz
dangina [55]

Answer:

The method definition to this question can be given as:

Method definition:

public void clear(int[] arr, int num) //define method clear.

{

   if (num == 0) //if block

{

       return 0;  return value.

}

else //else block

{

 arr[num - 1] = 0; //assign value in arr.

return arr[];  //return value.

}

}

clear(arr, num - 1);   //calling

Explanation:

The description of the above method definition as follows:

  • Firstly we define a method that is "clear" that does not return any value because its return type is "void". This method accepts two integer variables that are "arr[] and num" where arr[] is an array variable and num is an integer variable.
  • Inside a method, we use a conditional statement in if block we check that num variable value is equal to 0. if this condition is true so, it will return 0 otherwise it will go to else block in else block it will assign value in variable arr[num-1] that is "0" and return arr value.

4 0
2 years ago
The problem solving process begins by first ______ the problem.
alexandr402 [8]

Answer:

identifying/acknowledging

Explanation:

7 0
2 years ago
Which company has experienced censorship in China?
MariettaO [177]
Google experienced censorship in china. :) 
5 0
2 years ago
Read 2 more answers
A chess-playing computer program that routinely calculates all possible outcomes of all possible game moves best illustrates pro
Evgesh-ka [11]
<span>A chess-playing computer program that routinely calculates all possible outcomes of all possible game moves best illustrates problem solving by means of </span>brute force.
5 0
2 years ago
The path to the distribution share should always be referred to by the ____ path to ensure that it can be accessed over the netw
ch4aika [34]

Answer:

The answer is "Option D".

Explanation:

In the network, the UNC defines a related file with the removable drive from, which the file is stored without needing interpretation. It is used to ensure, that unguarded computers can be accessed across the network and other options, that can be clarified in the following terms which are not correct:  

  • In option A, It is used to manage computers and other devices on the internet, that's why it is wrong.
  • In option B, It is also known as a server that manages network security, that's why it is wrong.
  • In option c, It is used in software designing, that's why it is wrong .
6 0
2 years ago
Other questions:
  • Strlen("seven"); what is the output?
    14·1 answer
  • Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
    14·2 answers
  • Consider a short, 10-meter link, over which a sender can transmit at a rate of 150 bits/sec in both directions. Suppose that pac
    12·1 answer
  • Ken Olson, president of Digital Equipment Corp. in the late 1970's, Thomas J. Watson, chairman of IBM in the early 1940's, and T
    6·1 answer
  • What is the distance rn between the point of application of n⃗ and the axis of rotation? what is the distance rw between the poi
    15·1 answer
  • A semaphore puts a thread to sleep:
    12·1 answer
  • An Open Authorization (OAuth) access token would have a _____ that tells what the third party app has access to
    5·1 answer
  • Which XXX and YYY correctly output the smallest values? Vector user Vals contains integers (which may be positive or negative).
    15·1 answer
  • What prevents someone who randomly picks up your phone from sending money to themselves using a messenger-based payment?
    14·1 answer
  • What temperature is most commonly used in autoclaves to sterilize growth media and other devices prior to experimentation
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!