Question: a C++ program with a source file named ConvSecs.cpp that asks the user to enter a number of seconds and converts the seconds to days,
a C++ program with a source file named ConvSecs.cpp that asks the user to enter a number of seconds and converts the seconds to days, hours, minutes and remaining seconds. Your program will make use of long long int variables for all calculations. Note: the use of long long int requires that you have C++11 support. You should have this automatically if you are using a newer version of Visual Studio. The support is there for GCC as well, but you may need the -std=c++11 or -std=c++0x compiler flag.
For example, assuming the user enters 90061 for the seconds the output should be:
Day(s): 1 Hour(s): 1 Minute(s): 1 Remaining Second(s): 1 Your program should not accept seconds of zero or below. Display an error message telling the user that "seconds must be greater than 0" should they violate this rule.
Only display the leading label when the value of days, hours, minutes or seconds is more than zero.
For example, assuming the user enters 36011 for the seconds, the output should be:
Hour(s): 10 Second(s): 11 .
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
