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 the methods of exporting a function from a dll?

0 Answers  


Why do we use classes in programming?

0 Answers  


What are the static members and static member functions?

1 Answers  


How can you quickly find the number of elements stored in a static array?

0 Answers  


What is c++ vb?

0 Answers  


Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].

0 Answers  


Is c++ an oop?

0 Answers  


In the derived class, which data member of the base class are visible?

0 Answers  


Is c++ the best programming language?

0 Answers  


What are pointer-to-members? Explain.

0 Answers   iNautix,


total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.

0 Answers  


What are the c++ access specifiers?

1 Answers  


Categories