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
Ket [755]
3 years ago
11

Write a program to display MPH (Miles per Hour). Create a function to calculate the MPH. Ask the user for the number of miles dr

iven and the number of minute it took to drive that many miles. Validate that both the number of miles and the number of minutes is a positive, non-zero number. Pass both the number of miles and the number of minutes to the function, and have the function return the MPH.
Computers and Technology
1 answer:
puteri [66]3 years ago
7 0

Answer:

In Python:

def MPH(miles,minutes):

   mph = round(60 * miles/minutes,1)

   return mph

   

miles = float(input("Miles: "))

minutes = float(input("Minutes: "))

if miles>0 and minutes>0:

   print("MPH: ",MPH(miles,minutes))

else:

   print("Positive inputs only")

Explanation:

This defines the function

def MPH(miles,minutes):

This calculates mph rounded to 1 decimal place

   mph = round(60 * miles/minutes,1)

This returns the calculated mph

   return mph

The main begins here

This gets input for miles    

miles = float(input("Miles: "))

This gets input for minutes

minutes = float(input("Minutes: "))

If miles and minutes are positive

if miles>0 and minutes>0:

This calls the MPH function

   print("MPH: ",MPH(miles,minutes))

If otherwise, this prompts the user for positive inputs

<em>else:</em>

<em>    print("Positive inputs only")</em>

You might be interested in
The method used to transfer information to far off place instantly is called​
ahrayia [7]

Telecommunication

Explanation:

4 0
2 years ago
Read 2 more answers
Think of a genre (science, music, math, sports, video games, etc.) and create at least 10 questions. You can decide whether you
mojhsa [17]

<em>Answer:</em>

<em>When listing to studying music or calm music it will help you considerate on a test or any home work that you are doing </em>

<em>Explanation:</em>

<em>Since 2006, two UCF professors neuroscientist Kiminobu Sugaya and world-renowned violinist Ayako Yonetani have been teaching one of the most popular courses in The Burnett Honors College. “Music and the Brain” explores how music impacts brain function and human behavior, including by reducing stress, pain and symptoms of depression as well as improving cognitive and motor skills, spatial-temporal learning and neurogenesis, which is the brain’s ability to produce neurons. Sugaya and Yonetani teach how people with neurodegenerative diseases such as Alzheimer’s and Parkinson’s also respond positively to music. </em>

<em> </em>

<em>“Usually in the late stages, Alzheimer’s patients are unresponsive,” Sugaya says. “But once you put in the headphones that play [their favorite] music, their eyes light up. They start moving and sometimes singing. The effect lasts maybe 10 minutes or so even after you turn off the music.” </em>

<em> </em>

<em>This can be seen on an MRI, where “lots of different parts of the brain light up,” he says. We sat down with the professors, who are also husband and wife, and asked them to explain which parts of the brain are activated by music.</em>

7 0
3 years ago
If a node receives a frame and the calculated CRC does not match the CRC in the FCS,
Basile [38]

Answer:

It drops the frame

Explanation:

The FCS stands for the frame check sequence, and it is nothing else but an error-detecting code which is added to the frame ( communication protocol). However, the frames are being used for sending the payload data via a source to a certain destination. And if the CRC is not correct, or that does not match the CRC of the FCS then it confirms that the sequence is not correct, and FCS drops that frame.

5 0
3 years ago
hi friends I got the answer down load tutu app from chrome then from tutu app we can download any rare games for ex. Pokemon sun
svlad2 [7]

Answer: Cool!

Explanation: That's sounds amazing!^^

7 0
4 years ago
Question 2 of 3
frozen [14]

Answer: D

Explanation: You don't need to give money, information, or watch any inappropriate content on the gov website. It's safe and all you do is read.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Question 8 OT TU
    11·1 answer
  • Which of the following agricultural clusters would require administrative and financial training? biotechnology agribusiness sys
    8·1 answer
  • What are three responsibilities of an operating system? please answer quick!!!
    9·1 answer
  • ________ is/are used to temporarily hold small units of program instructions and data immediately before, during, and after exec
    11·1 answer
  • What problems have arisen regarding use of the Internet for global business transactions, and how are they being resolved?
    15·1 answer
  • What is the best Genshin impact ship? My favorite is Xiao x Lumine. Put yours bellow.
    13·2 answers
  • What is the purpose of a router
    13·2 answers
  • বর্তমান করােনার ন্যায় পরিস্থিতি অর্থাৎ স্বাভাবিক শ্রেণি কার্যক্রম পরিচালনা সম্ভব
    10·2 answers
  • What is analog computer? where is it used​
    6·2 answers
  • I am trying to do a python code quiz for school, the basic requirements for the quiz are: the quiz MUST have 10 questions
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!