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
While using the CLI on a Windows 10 64-bit computer with a single HDD and a single volume, you want to move from the current dir
dimulka [17.4K]

Answer:

50-64

Explanation:

We know this because I said so

5 0
3 years ago
At year end, Clean123 Inc. has 45500 in cash, 55000 in accounts receivable, 54400 in service equipment, 550 in prepaid insurance
Inessa [10]
Oh ok so yea and why you should but I
8 0
3 years ago
Prompt the user for an automobile service. Each service type is composed of two strings. Output the user's input. (1 pt) Ex: Ent
Svet_ta [14]

Answer:

Required code is given below.

Best Regards,

Please ask if any queries.

Explanation:

#include <stdio.h>

#include <string.h>

int main(void)

{

  char input[100];

  printf("Enter desired auto service:\n");

  scanf ("%[^\n]%*c", input);

  printf("You entered: %s\n",input);

  if(strcmp(input,"Oil change") == 0){

     printf("Cost of oil change: $35\n");

  }

  else if(strcmp(input,"Tire rotation") == 0){

     printf("Cost of tire rotation: $19\n");

  }

  else if(strcmp(input,"Car wash") == 0){

     printf("Cost of car wash: $7\n");

  }

  else{

      printf("Error: Requested service is not recognized\n");

  }

   

  return 0;

}

8 0
3 years ago
During the _____ of the systems development life cycle (SDLC), an information system is operating, enhancements and modification
Neporo4naja [7]

Answer:

Maintenance Phase

Explanation:

One of the concepts employed in project management for describing stages involved when carrying out an information system development project is the systems development life cycle (SLDC). The cycle which starts from carrying out a feasibility study and ends in maintenance is a highly used conceptual model. There are 5 major stages or phase and they are the; Requirement Phase, Design Phase; Implementation Phase, Test Phase, and the Maintenance phase. The maintenance phase comes when testing has been complete and all enhancement and modifications have already been developed, and the system is operating.

5 0
3 years ago
Select the correct answer. One of the functions of a data warehouse is to change table names to meaningful names. Which name is
Marianna [84]

Answer:

A. weekrep101

Explanation:

hope this worked and notice the update

6 0
3 years ago
Other questions:
  • When a crystal grows in unrestricted space, how does growth occur?
    14·2 answers
  • 4. The same data source can be used multiple times in creating mail-merge documents.
    7·1 answer
  • Ted wants to follow the StartSafe philosophy when working around electricity. Which of the following steps would be consistent w
    15·2 answers
  • Application partitioning gives developers the opportunity to write application code that can later be placed on either a client
    7·1 answer
  • _____ remove the part of an image starting from an edge​
    13·1 answer
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    14·1 answer
  • Write a C++ program that determines if an integer is a multiple of 7. The program should prompt the user to enter and integer, d
    13·1 answer
  • Short note on first generation computer​
    10·1 answer
  • Employing the use of a(n) <br> will help you manage a STEM project.
    13·1 answer
  • In the context of the data administration component of a database management system (DBMS), the acronym CRUD stands for _____.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!