Answer:
Code in C++
Explanation:
C++ Code
#include<iostream> //for input and output
using namespace std;
int main()
{
int hour;
int minute;
cout<<"Enter the hour:";
cin>> hour;
cout<<"Enter the minute:";
cin>>minute;
minute = minute+15;
if(minute>=60){
hour++;
minute=minute-60;
}
if(hour>=24){
hour=0;
}
cout<<"Hours: "<<hour<<endl;
cout<<"Minutes:"<<minute;
return 0;
}
Code Explanation
First we need to declare two int variables to hold hour and minute values input from user.
Check if by adding 15 minutes into minute entered by user is greater then or equal to 60 then increment into hour and subtract 60 from minute.
Another check is that if user enters more then 24 hour or by making increment into hour, the hour values i greater then or equal to 24 then we need to change the hour to 0.
Result
Case 1:
Enter the hour:8
Enter the minute:15
Hours: 8
Minutes:30
Case 2:
Enter the hour:9
Enter the minute:46
Hours: 10
Minutes:1
To check a document:
Open the document you want to inspect for tracked changes and comments.
Click the Microsoft Office Button , point to Prepare, and then click Inspect Document.
In the Document Inspector dialog box, click Inspect.
Review the inspection results. ...
Click Reinspect or Close.
<span>GUI is most useful in any program which needs event handling and graphical interface.</span>
Answer:
Technology has played a huge a part in terms of progressing the economies of different countries. Technology has brought into action the globalized solutions to bring people across the globe together.
Regardless of the benefits, this technology has caused people to socialize less in real life. They have found ways to entertain themselves through technology and that has effected their social interactions greatly.
Answer:
Following are the code to this question:
def binarynumber(num):#defining a method binarynumber that accepts a parameter num
x=""#defining a string variable x
if (num!=0):#defining if condition to check number not equal to 0
while (num>=1):#defining a loop that check value is grater then equal to one
if (num %2==0):#defining if condition to check num is even
x=x+"0" #add string value 0 in num variable
num=num/2 #divide the value by 2
else:#defining else block
x=x+"1"#add string value 1 in num variable
num=(num-1)/2#first subtract 1 into num variable then divide the value by 2
else:
x="0"#assign string value 0 in num variable
return "".join(reversed(x))#return value
num = int (input ("Enter any number: "))#defining num variable that input the integer value
print (binarynumber(num))#using print method to call method binarynumber with passing num parameter
Output:
Enter any number: 12
1100
Explanation:
- In the above python code a method "binarynumber" is declared, in which the "num" variable passes as the parameter inside the method a string variable "x" is declared that stores all converted values.
- Inside the method and if the block is declared that checks number value is not equal to 0 if this condition is false then it will add string value and reverse its value.
- Or if the condition is true it defines a while loop that calculates the given number binary digits and returns its value.
- At the last step, the num variable is declared that inputs the integer value from the user end and calls the method by using the print method.