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
Elanso [62]
3 years ago
5

Write a program that takes as input: - the current hour - the number of hours to add and outputs the new hour. For example, if t

he inputs are 2 (as the current hour) and 51 (as the number of hours to add), your program should output the answer from part (a) of this problem. Note that your program should always output an integer between 1 and 12. We will get you started with this program with the two lines that gather the input from the user. You'll need to write the rest.
Computers and Technology
1 answer:
mars1129 [50]3 years ago
5 0

Answer:

The program in Python is as follows:

cTime = int(input("Current Hour: "))

while(cTime <1 ):

   cTime = int(input("Current Hour: "))

aTime = int(input("Additional Hours: "))

while(aTime <0):

   aTime = int(input("Current Hour: "))

tTime = cTime + aTime

tTime%=12

print("New:",tTime,"hours")

Explanation:

This gets input for current time

cTime = int(input("Current Hour: "))

The following ensures that the user enters a time greater than 0

while(cTime <1 ):

   cTime = int(input("Current Hour: "))

This gets input for additional time

aTime = int(input("Additional Hours: "))

The following ensures that the user enters a positive time

<em>while(aTime <0):</em>

<em>    aTime = int(input("Current Hour: "))</em>

This calculate the new hours

tTime = cTime + aTime

This gets the hour equivalent between 1 and 12

tTime%=12

This prints the new hour

print("New:",tTime,"hours")

You might be interested in
Which would increase electric current? increasing the resistance increasing the size of the wire decreasing the voltage
Neko [114]
The answer is the second answer Increasing the size of the wire.
8 0
3 years ago
If we develop a new policy for our environment that requires us to use complex and automatically generated passwords that are un
stepan [7]

Answer:

The answer is "Login complexity will be increased very exponentially".

Explanation:

In computer science, The password is also known as a series of characters, which allows you to use the validation process to validate any customer's privacy.  

  • It is normal usage of passwords that work together with a username to make it, it only accessible by the user, and to give the user accessibility to a computer, software or web page.
  • If the password is more complex so, it is hard to learn, and it also provides login complexity, that's why we must use a less complex password.
7 0
3 years ago
Robyn needs to ensure that a command she frequently uses is added to the Quick Access toolbar. This command is not found in the
Semenov [28]

Answer: Access Quick Access commands using the More button

Explanation:

In order for Robyn to ensure that a command she frequently uses is added to the Quick Access toolbar, then she needs to Access Quick Access commands using the More button.

This can be done by clicking on Customize Quick Access Toolbar. Then, Robyn will then click More Commands then he'll click on file tab in the Choose commands from the list. The command will then be chosen and then click on Ok and it'll be added.

7 0
3 years ago
What is the code range for the integumentary system subsection in the cpt coding manual?
boyakko [2]
The code range is <span>10021-19499
</span>

Procedures on the integumentary system have their codes that range within 10021 – 19499 of the CPT manual. This is the 1st subsection of surgery. You will find codes for skin tag removal, incisions, and wound debridement at the front of the integumentary system.



6 0
4 years ago
Whenyou connect two batteries in a series, you add the voltages available in each battery and get the total voltage available to
LekaFEV [45]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

As we know that the voltage applied to a series circuit is equal to the sum of the individual voltage drops." This simply means that the voltage drops have to add up to the voltage coming from the battey or batteries. 5V + 3V = 8V.

So in this question, the correct answer is b.

Because, there are two batteries in a series circuit, each has 1.5 volts. when we add the voltage of these two batteries , we will get the total voltage i.e 3 volts from both batteries.

7 0
4 years ago
Other questions:
  • Windows uses a memory-management technique known as ________ to monitor which applications you frequently use and preloads them
    15·1 answer
  • Technlogies are having a negative impact on business true or false
    7·1 answer
  • What is the maximum transmission speed for bluetooth v3 and v4 devices?
    12·1 answer
  • What are the three parts of a Function
    12·1 answer
  • Say you write a program that makes use of the Random class, but you fail to include an import statement for java.util.Random (or
    10·1 answer
  • When a chart is selected, numerous customization options can be found on which Chart Tools tabs?
    11·2 answers
  • In a penetration test, a ________ team consists of IT staff who defend against the penetration testers. They are generally aware
    14·1 answer
  • Heather is troubleshooting a computer at her worksite. She has interviewed the computer’s user and is currently trying to reprod
    12·1 answer
  • Who is the father of computer?<br>1.Charles Babbage 2.James Waat​
    15·2 answers
  • True or false: Securing intellectual property digitally is the only security because that's how all IP is stored.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!