Answer:
hour = float(input("Enter hour:"))
minute = float(input("Enter minute:"))
second = float(input("Enter second:"))
am_pm = input ("Enter AM or PM:")
if am_pm == "AM":
if hour == 12:
hour = 0
seconds_since_midnight = ((3600 * hour) +(minute *60) + second)
elif am_pm == "PM":
seconds_since_midnight = ((3600 * (hour+12)) +(minute *60) + second)
print("Seconds since midnight:", int(seconds_since_midnight))
Explanation:
The point here is when PM is chosen, you need to add 12 to the hour. I added <em>elif</em> part to satisfy this. Moreover, since the output is in integer format, you may need to apply type casting for <em>seconds_since_midnight</em> variable.
Answer:
Maintenance, is the right answer.
Explanation:
A stage where the hardware of a machine is replaced due to some issues which make the machine work inappropriately is called the maintenance stage of the hardware. In this phase, some modifications are made in the hardware to support the operational effectiveness of the hardware. The customer executives try to improve the performance of the system and provide better security during replacing the hardware.
Answer:
The answer to this question can be given as:
Statement:
number = int(line.strip())
Explanation:
In the above statement, we declare an integer variable number accept the integer value from the file that name is line. In this line, we use the strip() function. This function returns a duplicate string with both starting and tracking characters removed (based on the string parameter passed). The strip() function removes characters from both sides (left and right) based on the parameter(a string defining the collection of characters to be removed).
Answer:
Following are the method definition to this question:
public String notice_bill(double amount) //defining method
{
return this.name+", account number "+this.currAccNum+", please pay $"+amt; //return value.
}
Explanation:
In the given question some information is missing, that is example So, method definition to this question can be described as follows:
- In the above method definition a string method "notice_bill" is declared, which accepts a double value in its parameter, that is "amount".
- Inside the method, this keyword is used, that hold values and return its value as a message.