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 statement best describes the Tell Me feature in PowerPoint 2016?
GrogVix [38]

Answer:

It provides detailed information about particular tasks within the program

3 0
3 years ago
What is the viewport?
Shtirlitz [24]
C. The viewing area of a web browser.

The viewport is the user's visible area of a web page.
5 0
3 years ago
Many people object to increased cybersecurity because _____.
yawa3891 [41]
Depending on what kind of security measures are implemented, D would definitely be a contender. However, B is also something to take into consideration. I would answer D.<span />
5 0
4 years ago
Read 2 more answers
Bertha was recording a drama club practice. during editing, she noticed that she missed recording the beginning of a shot in the
Ray Of Light [21]

Bertha should use end roll technique so that she doesn't miss the initial action of a drama.

b. end roll

<u>Explanation:</u>

End roll is a simple method to decide whether the film is pushing ahead or not. When you utilize the film advance to wind the film, you essentially need to check if the handle on the left (that you use to rewind the film) is turning.

In the event that it turns, great, it implies that the film is appropriately locked in. So Bertha should utilize the end move strategy with the goal that she doesn't miss the underlying activity of a dramatization.

5 0
3 years ago
What does Technology mean to you?​
brilliants [131]
Technology is the collection of techniques, skills, methods and processes used in the production of goods or services or in the accomplishment of objectives, such as scientific investigation. Technology can be the knowledge of techniques, processes, etc. or it can be embedded in machines, computers, devices and factories, which can be operated by individuals without detailed knowledge of the workings of such things.
8 0
3 years ago
Read 2 more answers
Other questions:
  • In databases and database-related software, which choice is not a Boolean operator?
    7·2 answers
  • Word processing, presentation, photo editing, and video games are all types of what?
    9·2 answers
  • You can change the transparency of a picture used as a slide’s background with the ____.
    10·1 answer
  • What is the best operating system
    12·1 answer
  • To determine the average of a range of numbers, click the ____ in the formula bar, then click average.
    13·1 answer
  • The Harrison Group Life Insurance company computes annual policy premiums based on the age the customer turns in the current cal
    5·1 answer
  • Python: Bad input on line 8. What is the fix, please can someone tell me I’m desperate?
    10·1 answer
  • List at least 5 professions for people working in the Information/Communication<br> fields.
    10·1 answer
  • What are the paparazzi?
    8·1 answer
  • Help please i will mark brainlist!
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!