Question: Language is C++ Write a function validatedTime(hours, minutes, seconds), that prints a valid time in 24 hours format. It adjusts any of the variable if

Language is C++
Write a function validatedTime(hours, minutes, seconds), that prints a valid time in 24 hours format. It adjusts any of the variable if it's out of its valid range e.g. 65 seconds will be adjusted to 5, incrementing 1 in minutes. main function is provided, you have to make it working. Function Description validatedTime have default value of zero for hours, minutes, and second. Hence it can be called by providing none, one, two, or three arguments. Details Sample Input For Custom Testing 5 30 65 Sample Output 00:00:00 05:00:00 05:30:00 05:31:05 Explanation Input is read as hours = 5, minutes = 30, seconds = 65. Then the function is called 4 times, with different number of arguments passed. The seconds are adjusted in last call. Details
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
