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
2 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]2 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
Where should Nolan go to change the font size of his message before printing it? A.the Paper tab in the Define Styles dialog box
Ahat [919]
<span>D.dialog box the Format tab in the Page Setup dialog box' is the answer. Hope I helped!</span>
8 0
3 years ago
Victoria has a .... of playing with her hair when she gets nervous​
IrinaK [193]

Answer:

Victoria has a tendency of playing with her hair when she gets nervous.

Explanation:

I believe this is what you are asking for.

:))))

6 0
3 years ago
There are six different sequences for the three approval tasks: check inventory; check credit; check special terms.
Lana71 [14]

Answer:

i dont know i am 13

Explanation:

3 0
3 years ago
How does computer applications affect our lives daily? 1- paragraph (4 sentences)
Mnenie [13.5K]

Answer:

Computers affect our lives daily because we use them everyday to browse the internet and solve problems in real life. They help solve problems and without them, getting certain information would be much harder. They help us interact with friends from anywhere in the world and communicate with relatives. It has also helped us during this pandemic and lets us learn from school in the safety of our own home.

( hope this helps, i wrote it myself ;-; )

4 0
3 years ago
Read 2 more answers
The Save command saves your changes silently without additional prompts, using the same save settings; the Save As command reope
kirza4 [7]

The "Save command" saves your changes <u>silently</u> without additional prompts and it uses the same save settings while the "Save As command" <u>reopens</u> the Save screen: True.

What is the Save command?

A Save command can be defined as a type of command associated with the file menu of a software application and it causes a copy of the current file to be created and stored to a specific location on a computer system.

<h3>What is the Save as command?</h3>

A Save command can be defined as a type of command associated with the file menu of a software application and it causes a copy of the current file to be created and stored to a different location, file name, and/or file type.

In conclusion, the "Save command" saves your changes <u>silently</u> without additional prompts and it uses the same save settings while the "Save As command" <u>reopens</u> the Save screen, so as to enable you make different choices.

Read more on Save command here: brainly.com/question/16852455

5 0
2 years ago
Other questions:
  • What is microsoft excel
    12·1 answer
  • A(n) _____ is a type of server that stores computer software, which users can access from their workstations.
    6·1 answer
  • Andy, a developer, is designing a new program. Which tool should Andy use to help him complete his task?
    13·1 answer
  • In science class, Patricia is giving a presentation on the different types of flowers in her community. As part of her presentat
    5·1 answer
  • Match each career to its various job roles. digital media coordinator digital media specialist photographer sound producer creat
    13·1 answer
  • The Advanced Properties sheet enables you to add which of the following?
    15·1 answer
  • What is the volume of a rectangular prism with a length of 812 centimeters, width of 913 centimeters, and a height of 1225 centi
    12·1 answer
  • Which feature helps an edit-test-bug cycle work faster in the python programming language?
    15·2 answers
  • What is the difference between computer hardware and computer software?<br>​
    10·1 answer
  • . Question 2 Fill in the blank: R Markdown notebooks can be converted into HTML, PDF, and Word documents, slide presentations, a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!