Write a program which is required to process the time of a
clock in hours and minutes, entered from the keyboard. With
this program, there are two requirements for any data
entered by a user:
1. The data must be of the correct type (in this case, two
ints).
2. The data must be in the correct range: this means that,
for the minutes, negative numbers and any number above 59
must be rejected; for the hours, negative numbers and any
number above 23 must be rejected.
Output error message for invalid data input.
Output the time one and a half hour after the time input.
i.e.
Hour: 22
Min: 32
One and a half hour after 22:32 is 00:02


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C++ General Interview Questions

What are move semantics?

0 Answers  


How do we implement inheritance in c++?

0 Answers  


Is there a sort function in c++?

0 Answers  


Can we remove an element in a single linked list without traversing? Lets suppose the link list is like this 1 2 3 4 5 6 We need to remove 4 from this list (without traversing from beginning) and the final link list shud be 1 2 3 5 6 only thing we know is the pointer to element "4". How can we remove "4" and link "3" to "5"?

6 Answers   CSC,


If all is successful, what should main return a) 0 b) 1 c) void

0 Answers  






Explain the term memory alignment?

0 Answers  


What is iomanip c++?

0 Answers  


What is operator overloading in c++ example?

0 Answers  


write a program that will produce the ff. output. "what fruit will you buy? 1)apple 2)orange 3)mango ENTER CHOICE (1,2 or 3)> HOW MANY WILL YOU BUY?> THAT WILL COST XX.XX

1 Answers  


What is a responder chain?

0 Answers  


List the advantages of inheritance.

0 Answers  


Which of the following is evaluated first: a) && b) || c) !

0 Answers  


Categories