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
Cerrena [4.2K]
2 years ago
13

Write a function called mul_time that takes a Time_Elapsed object and a number and returns a new Time_Elapsed object that contai

ns the product of the original object and the number. Then use mul_time to write a function that takes a Time_Elapsed object that represents the finishing time in a race, and a number that represents the distance, and returns a Time object that represents the pace (time per mile). The function should return a nicely formatted pace in hour, minutes and second per mile
Computers and Technology
1 answer:
lisov135 [29]2 years ago
7 0

# Write a function called mul_time that takes a Time object and a number and

# returns a new Time object that contains the product of the original Time and

# the number.

# Then use mul_time to write a function that takes a Time object that

# represents the finishing time in a race, and a number that represents the

# distance, and returns a Time object that represents the average pace (time

# per mile).

# Current Status: Complete

class Time(object):

   """ represents the time of day.

   attributes: hour, minute, second"""

time = Time()

time.hour = 3

time.minute = 0

time.second = 0

def time_to_int(time):

   minutes = time.hour * 60 + time.minute

   seconds = minutes * 60 + time.second

   return seconds

def int_to_time(seconds):

   new_time = Time()

   minutes, new_time.second = divmod(seconds, 60)

   time.hour, time.minute = divmod(minutes, 60)

   return time

def mul_time(time, multicand):

   time_int = time_to_int(time) * multicand

   new_time = int_to_time(time_int)

   if new_time.hour > 12:

       new_time.hour = new_time.hour % 12

#    print ("New time is: %.2d:%.2d:%.2d"

#    % (new_time.hour, new_time.minute, new_time.second))

   return new_time

# mul_time(time, 2)

def race_stats(time, distance):

   print ("The finish time was %.2d:%.2d:%.2d"

         % (time.hour, time.minute, time.second))

   print "The distance was %d miles" % (distance)

   average = mul_time(time, (1.0 / distance))

   print ("The average is: %.2d:%.2d:%.2d per mile"

         % (average.hour, average.minute, average.second))

race_stats(time, 3)

You might be interested in
_____ oversee the work of various types of computer professionals and must be able to communicate with people in technical and n
viktelen [127]

Systems analysts oversee the work of various types of computer professionals and  communicate with people in technical and nontechnical terms.

<h3>Who works in an information systems?</h3>

The information systems field is known to be made up of people in a firm who set up and build information systems, the individuals who use those systems, and the people who are known to managing them.

Note that there is high demand for IT staff whose common example includes programmers, business analysts, systems analysts, etc.

Learn more about computer from

brainly.com/question/24540334

4 0
2 years ago
Range paramters - for loop<br> question in picture
Luba_88 [7]

Answer:

start,stop,step_size

Explanation:

Starting at 5 to for loop will count backward by 1 (hence the step_size being -1) until it reaches 0 (stop).

4 0
2 years ago
When sending an electronic cover letter, an e-mail address is sufficient contact information.
Irina-Kira [14]

Answer:

False is the correct answer for the above question.

Explanation:

"Electronic cover letter" is a cover letter which is used with a resume or CV to state the additional information of that CV or resume. It is a cover letter attached to some documents. Just like, If a person bought some books then there is also a book cover attached with it which states about the book author and some other details about the book.

Just like, when a person writes a resume or CV then there is also needs a cover letter which is called "Electronic cover letter". To attach the cover letter a user needs a resume and to send that a user needs an email. So there are two important things to send the cover letter-- email address and document. But the question states that only email is important which is not correct. So the question statement is a false statement.

3 0
3 years ago
Read 2 more answers
The ____ refers to a world where everyday physical objects are connected to, and uniquely identifiable on, the Internet so they
Gnoma [55]

Answer:

Internet of Things IoT

Explanation:

Internet of things refers connection of devices (physical objects around us) which have been enable to send and receive data (communicate over the internet). Each object in an IoT system is uniquely identifiable and communicates with others without the need for human interaction.

Some examples of objects and systems where IoTs are deployed include; security systems, cars and appliances at homes

4 0
4 years ago
design aDesign a queue abstract data type for float elements in a language that you know, including operations for enqueue, dequ
Yuri [45]

Answer:

Check the explanation

Explanation:

Due to difficulty in submitting the code on the brainly text editor, it has been written and uploaded, check the below attached image that shows the designed queue abstract data type <u><em>(which is defined by the following operations and structure, when a queue is structured, as expressed in the above statement, as an prepared or structured item collection which are added at one end, that is often called the “rear,” and detached from the other end, called the “front.”) </em></u>for float elements.

8 0
3 years ago
Other questions:
  • The purpose of the ________ element is to describe the contents of a table.
    15·1 answer
  • You have a hard disk that is formatted with the fat32 file system. you would like to implement file and folder permissions on th
    10·1 answer
  • tuition $36,620 room and board $12,900 books and fees $2,450 transportation $3,100 other $1,330 . Emily is using the table to de
    8·2 answers
  • What needs to be increased in order to increase image size and clarity?
    10·1 answer
  • Which type of computer network ensures high quality​
    9·1 answer
  • The Windows Remote Desktop Web connection that allows users to connect to a work or home computer and access files is considered
    7·2 answers
  • What does NCR stand for
    12·2 answers
  • What is the web of trust
    7·2 answers
  • What property must be set on a menu item to have the user activate that option by pressing Ctrl C on the keyboard
    11·1 answer
  • List the difference between GIGO and bug ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!