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
What is the difference between simple and complex waveforms?
Nataliya [291]
Simple waveform - something like a sine wave. Very pure sound like you used to get on the tv when that girl was sitting with the toys in the middle of the night. Complex waveform is like speech etc
5 0
3 years ago
Given the availability of an ifstream object named input, write the other statements necessary to read an integer into a variabl
tatiyna

Answer:

input.open("rawdata");

input>>datum;

input.close();

Explanation:

ifstream objects maintain a filebuf object as their internal stream buffer, and perform operations like input/output on the available associated files.

In above statements.

                            input.open("rawdata");

  • The associated file named rawdata is opened.

                            input>>datum;

  • The integer from the file is read into already declared variable datum.

                             input.close();

  • Input stream is closed.
4 0
2 years ago
You can use the ____ utility to zero in on the service or other program that is slowing down startup. 1. gpupdate 2. MSconfig 3.
Step2247 [10]
I'd say MSconfig, you can use that and view the 'processes' tab, but it will make you open up the task manager.
3 0
3 years ago
How should you respond to the theft of your identity cyber awareness.
antiseptic1488 [7]

The way to respond to the theft of your identity cyber awareness is; To report the crime to the local commission which is the Federal Trade Commission (FTC).

<h3>Protection from Identity Theft</h3>

Identity Theft is basically a crime that happens happens when someone steals your personal information and uses it commit a fraudulent offence.

Now, the person that stole your identity may use the stolen information he got from you to apply for credit, file taxes, medical services or other government privileges.

The acts perpetuated above by the thief could lead to damage to your reputation with credit status and your good name too which could take years to rebuild.

Thus, it is very pertinent to report any case of such to the relevant government commission which in this case is Federal Trade Commission (FTC).

Read more about Identity Theft at; brainly.com/question/15252417

5 0
2 years ago
Question 12
AlladinOne [14]

Which is a multicast address ?

ans: 241.2.2.1

6 0
2 years ago
Other questions:
  • The overall purpose of a food guide is________.
    11·1 answer
  • Which method of the form passes data without appending the parameters to the url?
    5·1 answer
  • HURRY
    5·1 answer
  • Enlist the various data analysis methods for study of Infrasonic waves, Seismic waves, Earthquake prone areas and how AI can be
    15·1 answer
  • A location in memory used for storing data and given a name in a computer program is called a because the data in the location c
    14·1 answer
  • A large IPv4 datagram is fragmented into 4 fragments at router 1 to pass over a network with an MTU of 1500 bytes. Assume each f
    15·1 answer
  • Select the correct answer.
    15·2 answers
  • The _____ component of a decision support system (DSS) includes mathematical and statistical models that, along with the databas
    14·1 answer
  • Which requires large computer memory?
    15·1 answer
  • A group of two or more computer systems linked together via communication devices is called:.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!