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
velikii [3]
3 years ago
7

Complete the function ending_time that determines the final clock time after a task has been completed. The function takes three

arguments that provide the current time of day, as well as the total time in seconds that it will take to complete the task: hour: the current hour of the day (0 - 23) minute: the current minute of the day (0 - 59) second: the current second of the day (0 - 59) time_taken: the number of seconds it will take to complete the task (greater than 0) Assume all inputs are valid. time_taken can be arbitrarily large! As an example, consider the test case: 2, 59, 40, 22. This means that the current hour is 2, the current minute is 59, the current second is 40, and the time to complete the task is 22 seconds. So the first three function arguments represent the time 2:59:40 am.
Computers and Technology
1 answer:
Ivanshal [37]3 years ago
8 0

Answer:

  1. def ending_time(hour, minutes, seconds, work_time):
  2.    if((seconds + work_time) // 60 > 0):
  3.        minutes = minutes + (seconds + work_time) // 60
  4.        seconds = (seconds + work_time) % 60    
  5.        if(minutes // 60 > 0):
  6.            hour = hour + (minutes // 60)
  7.            minutes = minutes % 60
  8.    else:
  9.        seconds = seconds + work_time  
  10.    return str(hour) + ":" + str(minutes) + ":" + str(seconds)
  11. print(ending_time(2,30,59, 12000))

Explanation:

The solution code is written in Python 3.

Firstly create a function ending_time that takes the four required input parameters.

Next, create an if statement to check if the numerator of (seconds + work_times) divided by 60 is over zero. If so, increment the minute and reassign the remainder of the seconds to the variable (Line 2-4).

Next, create another if statement again to check if the numerator of (current minutes) divided by 60 is over zero, if so increment the hour and reassign the remainder of the minutes to the variable (Line 6-8)

Otherwise, just simply add the work_time to the current seconds

At last return the time output string (Line 12).

You might be interested in
Someone asks you for help with a computer that hangs at odd times. You turn it on and work for about 15 minutes, and then the co
d1i1m1o1n [39]

Answer:

C. Wait for about 30 minutes for the system to cool downand try again.

Explanation:

In computer system troubleshooting, there are two areas where problems can arise. They are hardware and software related issues.

software issues are application related like an application not installed properly, malicious software attack, corrupted operating system etc, while hardware has to do with a faulty hardware component in the system.

Example of a hardware related issue, when the active fan is faulty, the computer overheat and eventually shuts down to cool the system. When it cools down, the computer can boot again.

To confirm that the fan is faulty, when it shuts down to cool, wait for some time and try booting the system again. If it comes on, then the fan is bad.

8 0
3 years ago
The signature area in a cover letter includes the sender's first and last name, followed by his/her job title (if applicable). *
jeyben [28]

Answer:

True is the correct answer to the given question.

Explanation:

The main objective of the cover letter is to describe the people during the job application .The cover letter describe your self in the proper manner in the interview .The cover letter incorporates the first and the last names of the sender, preceded by the job title.

  • The cover letter is  to highlighted how to main criteria of the job role suit in the particular mix of expertise and experience.
  • The cover letter increases the opportunity to show the direct correlation among the employer's knowledge , experience and the skills .
  • Therefore the given statement is true .
7 0
3 years ago
To order the records in the answer to a query in a particular way, you ____ the records.
Alex_Xolod [135]
To order the records in the answer to a query in a particular way, you "Sort" the records. Sorting the records will allow the user to sort the sequence of the records based on his or her preferences, he or she may sort it ascending or descending.<span />
8 0
2 years ago
Suppose barriers to entry exist in the telecommunications industry. This best describes a _____ market.
melamori03 [73]
The correct answer for the question that is being presented above is this one: "monopolistic." Suppose barriers to entry exist in the telecommunications industry. This best describes a monopolistic market. In a <span>monopolistic market, that specific source of service or good, is being handled by a single company.</span>

4 0
2 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:
  • Code the function (insertNth list N insValue) which constructs a new list by inserting the specified insValue into the list afte
    6·1 answer
  • Why laptop computer is called micro computer?​
    8·1 answer
  • When creating a chart or graph, which should be completed first?
    9·2 answers
  • Hurry im TIMED
    8·1 answer
  • Fill in the blanks
    7·1 answer
  • Consider the following declaration:
    9·1 answer
  • 5. Write the name of the tab, command group, and icon you need to use to access the
    11·2 answers
  • Jerry purchased 25 dozens of eggs. He used 6 eggs to bake 1 cake. How
    14·1 answer
  • A business needs to open at the right ___________ and the right ______________. Choose all correct answers.
    9·1 answer
  • I need to send this in ASAP
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!