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
lara [203]
3 years ago
13

Write a program to take in a time-of-day on the command-line as 3 integers representing hours, minutes, and seconds, along with

a 4th argument of additional seconds. Recompute the time by adding the additional seconds to the time in the first three command-line arguments. Output: - display the original time given on the command-line - display the newly computed time Example: python computeTime.py 5 59 32 30 Initial time: 5:59:32 Computed time: 6:00:02 {6:0:2 would also be acceptable}
Computers and Technology
1 answer:
nexus9112 [7]3 years ago
6 0

Answer:

In Python:

hh = int(input("Hour: ")) * 3600

mm = int(input("Minutes: ")) * 60

ss = int(input("Seconds: "))

seconds = int(input("Additional Seconds: "))

time = hh+ mm + ss + seconds

hh =  int(time/3600)

time = time - hh * 3600

mm = int(time/60)

ss = time - mm * 60

while(hh>24):

   hh = hh - 24

print(str(hh)+" : "+str(mm)+" : "+str(ss))

Explanation:

We start by getting the time of the day. This is done using the next three lines

<em>hh = int(input("Hour: ")) * 3600</em>

<em>mm = int(input("Minutes: ")) * 60</em>

<em>ss = int(input("Seconds: ")) </em>

Then, we get the additional seconds

<em>seconds = int(input("Additional Seconds: "))</em>

The new time is then calculated (in seconds)

<em>time = hh+ mm + ss + seconds</em>

This line extracts the hours from the calculated time (in seconds)

hh =  int(time/3600)

time = time - hh * 3600

This line extracts the minutes from the calculated time (in seconds)

mm = int(time/60)

This line gets the remaining seconds

ss = time - mm * 60

The following iteration ensures that the hour is less than 24

while(hh>24):

   hh = hh - 24

This prints the calculated time

print(str(hh)+" : "+str(mm)+" : "+str(ss))

You might be interested in
Back injuries are very common in humans and are often caused by lifting objects with the legs straight while leaning over; also
saveliy_v [14]

Answer:

Back injuries are some of the most common injuries that occur when handling heavy objects, for example, when working in truck loading and unloading jobs, or lifting weights in a gym.

This type of injury is mainly caused by incorrect posture or body position when handling these weights. In essence, it is recommended that the back remain rigid and upright to avoid pressure on the lumbar zone and the cervical discs, transferring the center of force towards the legs (which have a capacity to exert much greater force than the mid-torso and back area). low).

In this way, the torque or upward pushing force that lifts the manipulated weights arises from the hamstrings and quadriceps, rather than directly out of the waist area. This prevents injuries such as herniated disc or low back pain, which are very painful and difficult to treat.

8 0
3 years ago
3. Wi-fi connections have limited range of :
Tamiku [17]

Answer: D) 300 metres would be my choice because our wifi can only go that far outdoors, inside wifi can only travel up to 150 metres.

Explanation: Hope this helps! Have a wonderful day!

Don’t forget to thanks & Brainliest is always appreciated!

3 0
3 years ago
Networking Gadgets, Inc. currently employs eight people but plans to hire 10 more in the next four months. Users will work on mu
grandymaker [24]

Answer: Server based network

Explanation:

 The server based network is the type of network in which the special type of computer mainly handle the various networking tasks like the storing file, managing printers and authenticate the users in the system. The server based network are also responsible for run various types of application like the email and the database system.

The microsoft windows 2016 and the window 2012 are the two ideal OS (Operating system) that mainly used in the server based network.

Therefore, we use the server based network as it easy to backup and manage in the networking system.

3 0
4 years ago
Why should you need to have skills and an understanding about programming?
romanna [79]
It could help you in the future if you want to master in it later on, it all depends on what you feel is right for you.
5 0
4 years ago
To determine if the bank's Web site is secure, look at the web site address.
Aneli [31]
True It Will Have A Green Lock At The Top If It Is Secure Website If It Is Unsecured It Will Have A Red Unlocked Lock At The Top. <span />
4 0
3 years ago
Read 2 more answers
Other questions:
  • What decimal number does the bit pattern 0×0c000000 represent if it is a two's complement integer?
    5·1 answer
  • What is the definition of Microsoft Operating System?<br>​
    8·2 answers
  • Online companies typically have a(n) _________ on their websites that clearly states what information is collected from users an
    7·1 answer
  • Binary is best interpreted by a computer because?
    8·2 answers
  • Which 10 gigabit standard uses mmf cabling for distances up to 300 meters and is often used for sonet campus networks?
    8·1 answer
  • What were the technological innovations that allowed for the rapid expansion of the railroads?
    6·1 answer
  • A student has created a Book class. The class contains variables to represent the following.An int variable called pages to repr
    11·1 answer
  • A(n) ______ page is the page on a website that a visitor sees when he or she clicks a link from an ad, a search engine result, o
    6·1 answer
  • WHHY AM I GIVING POINTS AWAY
    7·1 answer
  • O O O O O O O
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!