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
Where else can the computer send the results of processing other than to output​
hjlf

Explanation:

it can also be sent through flashdrive

3 0
2 years ago
If html is used to specify the content of the webpage, then what do you use css for?.
alekssr [168]

Answer:

css for styling.. means for making websites looks beautiful and attractive

Explanation:

html is like skeleton which defines websites structure whereas css is like cover to the skeleon.. css is responsible for fonts, colors, position of elements, responsiveness of websites.. it makes websites looks beautiful and prettier by adding background colors, hover effects, animation, etc

6 0
2 years ago
Using C++
sweet-ann [11.9K]

Answer:

#include<iostream>

using namespace std;

void OutputMinutesAsHours(double origMinutes) { //Same as question

   double hours=origMinutes/60; //solution is here

   cout<<hours;

}

//Below is same as mentioned in question

int main() {

OutputMinutesAsHours(210.0);

cout << endl;

return 0;

}

OUTPUT :

3.5

Explanation:

In the above code, only two lines are added. To convert minutes into hours we have to divide them 60, so we take minutes as input and define a new variable of double type which stores minutes converted to hours and then that variable is printed to console. For 210, it gives 3.5, similarly for 3600 it gives 60 and so on.

6 0
3 years ago
Interactive sites where users write personal topics and comments to a threadded discussion are called?
Eddi Din [679]
The correct answer would be Forums
5 0
3 years ago
Who would be a member of the American Dental Association?
ycow [4]

Answer:

a pratcing dentist

Explanation:

4 0
3 years ago
Other questions:
  • Properly defined the primary part of a CPU​
    5·1 answer
  • An Internet Service Provider (ISP) is a company that builds the routers and wired connections that allow individuals to access t
    12·2 answers
  • What is an electronic tool that stores large amounts of data in one place in a systematic, logical way? A Database B Platform C
    5·1 answer
  • How many generations of computer languages have there been since the middle of the 20th century?
    10·1 answer
  • Suppose that class OrderList has a private attribute double cost[100] which hold the cost of all ordered items, and a private at
    14·1 answer
  • What is one of the most helpful things about having a role model?
    10·2 answers
  • Password is an example of an authentication mechanisms that is based on " what an entity has".
    6·2 answers
  • Please help Ill give you brainliest if I get 2 answers. Which is used to input information on a laptop?
    6·1 answer
  • Determine whether the phrase below is a sentence or a fragment.
    12·1 answer
  • What’s Discord Packing?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!