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
MrMuchimi
3 years ago
10

Many people keep time using a 24 hour clock (11 is 11am and 23 is 11pm, 0 is midnight). If it is currently 13 and you set your a

larm to go off in 50 hours, it will be 15 (3pm). Write a Python program to solve the general version of the above problem. Your program should first prompt the user for the time now (in hours) and for the number of hours to wait for the alarm, then store those values as type int variables time_now and wait_time respectively, and finally print the time on the 24 hour clock when the alarm will go off.
Computers and Technology
1 answer:
lozanna [386]3 years ago
6 0

Answer:

<em>The program written in Python is as follows;</em>

time_now = int(input("Time: "))

wait_time = int(input("Alarm: "))

time_now = time_now + wait_time%24

if time_now < 12:

     print(str(time_now)+"am")

else:

     time_now = time_now - 12

     print(str(time_now)+"pm")

Explanation:

This line prompts user for current time

time_now = int(input("Time: "))

This line prompts user for the alarm hours

wait_time = int(input("Alarm: "))

This line calculates the time of the alarm

time_now = time_now + wait_time%24

The following if statement determines if the time will be am or pm

If the time is less than 12, then the time will be in am

<em>if time_now < 12: </em>

<em>      print(str(time_now)+"am") </em>

If otherwise,  then the time will be in pm

<em>else: </em>

<em>      time_now = time_now - 12 </em>

<em>      print(str(time_now)+"pm")</em>

<em></em>

You might be interested in
You must establish credit in order to buy a house true or false
iren2701 [21]

verry true, unless ou dont need a loan, if you have cash then the answer is false

8 0
3 years ago
Which two factors most influenced the growth of the Internet during the 1970s?
eduard

Answer:

The answer is "increase in the power of public universities and increased appreciation for a liberal arts education". DARPA and Russia had nothing to do with this. Yes, the computer hardware improvement led to a growth, but National Science Foundation funding in 1981, and hence this is also not an option. And electrical power supply had nothing to do with this. Hence, the above answer. as the concept of the internet is based on liberal arts of education, to impart practical and intellectual skillsets, and hence to grow the social responsibility among the citizens of the whole world. Also, the power of public universities had a big role to play definitely, and this was confirmed from Pentagon as well then when the question was raised, is this due to the risk of a nuclear attack.

Many people think that the main reason was the nuclear attack threat, but that was not an issue definitely. Actually this was the time of liberalization, and the power of the public universities was increased. Hence, they got the chance to share the information of various sorts with the people, and in the process internet started expanding.

Explanation:

The answer is self explanatory.

8 0
3 years ago
Read 2 more answers
4. Why isn't it realistic to market a new product using promoted tweets?
erica [24]

Answer:

Great question

Explanation:

is not realistic because nearly everyone doesn't even consider to look at the ad. Most people actually find it annoying when they are scrolling on their feed and all of a sudden an ad pops up.

3 0
3 years ago
Read 2 more answers
How do you mark someone brainliest?
Stolb23 [73]

Answer:

it will be on the bottom right of a answer :)

Explanation:

6 0
2 years ago
Read 2 more answers
I just want to say thanlouy for all the branlies on this app
Gnom [1K]

Answer:

that's just what we do :D

Explanation: because we're awesome UvU

7 0
3 years ago
Other questions:
  • In Python Calculate the BMI of a person using the formula BMI = ( Weight in Pounds / ( ( Height in inches ) x ( Height in inches
    9·1 answer
  • before donating a computer you should use a program to wipe the hardest to remove all of his data true or false
    6·1 answer
  • If a user has just added a simple triangle shape into a diagram, how can the triangle be adjusted? Check all that apply. by maki
    6·2 answers
  • Given a int variable named yesCount and another int variable named noCount and an int variable named response write the necessar
    6·1 answer
  • When an interrogator speaks highly about how a crime was committed, hoping to get the suspect to brag about his or her involveme
    7·2 answers
  • When disabling inherited permissions on an object, what happens if you select Remove all inherited permissions from this object?
    11·1 answer
  • What was the first portable computer called and who made it?
    9·1 answer
  • Shane is working on a new project for the sales department. The company wants a way to allow the sales force to print orders at
    5·1 answer
  • Help me
    5·1 answer
  • Tabs are usually set ________ to the right of the left margin.
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!