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
What is the full form of bcc please tell​
expeople1 [14]

Blind Carbon Copy

For emails. It is used to send a copy of the email to somebody without the original person receiving it knowing that you sent a copy.

3 0
3 years ago
Read 2 more answers
Write an if statement that assigns 0.2 to commission if sales is greater than or equal to 10000.
7nadin3 [17]
If (sales >= 10000)
commission = 0.2;
8 0
2 years ago
A ________ pays out cash flows from a collection of assets in different tranches, with the highest-rated tranch paying out first
KonstantinChe [14]

Answer:

The correct option to the following question is CDO(Collateralized Debt Obligation).

Explanation:

CDO(collateralized debt obligations), is the financial tool that is used by the banks to repackage the individual loans into the product sold to the investors on secondary markets.

It developed as the instruments for corporate debts markets, after the year 2002, CDO became the vehicles for refinancing the mortgage backed the securities.

A CDO is the type of the structured asset backed security.

3 0
3 years ago
Create a SELECT statement that returns the count, average, max and min of the invoices submitted by each vendor, who has submitt
sveta [45]

Answer:

SELECT Count(order_invoice) as number_of_invoices, Max(order_invoice) as maximum_invoice, Min(order_invoice) as minimum_invoice, Avg(order_invoice) as average_invoice

FROM vendor JOIN invoice ON invoice.id = vendor.id

WHERE order_invoice > 1

ORDER BY number_of_invoices DESC

Explanation:

The select statement of the SQL or structured query language returns twelve rows of four columns from the inner join of the vendor and invoice table in a database where the order_invoice column in the invoice table is greater than one. The result of the query is ordered by the alias column "number_of_invoices" in descending order.

8 0
2 years ago
Write a program to find the product of 3 numbers
ziro4ka [17]

Answer:

#include<iostream>

using namespace std;

int main()

{

   int a,b,c;

   cout<<"enter the value of a:";

   cin>>a;

   cout<<"enter the value of b:";

   cin>>b;

   cout<<"enter the value of c:";

   cin>>c;

   cout<<"product is:"<<(a*b*c);

   return 0;

}

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • What is the purpose of filters in a data base
    11·1 answer
  • When you arrive at work one morning, your inbox is full of messages complaining of a network slowdown. you collect a capture fro
    12·1 answer
  • ____ languages create source code using words and structures similar to spoken language.​
    15·1 answer
  • On what basis can you categorize the generations of computers?
    5·1 answer
  • A Silicon Valley billionaire purchases 3 new cars for his collection at the end of every month. Let a_n denote the number of car
    8·1 answer
  • The parameter passing mechanisn used in C is
    5·2 answers
  • PLEASE HURRY 30 POINTS
    15·2 answers
  • Select the correct answer from each drop-down menu. What are the effects of emerging technology? has brought the internet to alm
    10·1 answer
  • Which one way in which using infrared in game console controllers could affect the experience of a person playing the game?
    8·1 answer
  • Range paramters - for loop<br> question in picture
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!