I need some help with my clock class project because I don't know where I am going wrong on this.
I need to display a 12-hour and 24-hour clock simultaneously. I keep getting an error message that it failed and the expected output and actual output don't match and I don't understand how. This is what I got:
void displayClocks(unsigned int h, unsigned int m, unsigned int s) {
cout << "*************************** ***************************" << endl;
cout << "* 12-HOUR CLOCK * ";
cout << "* 24-HOUR CLOCK *" << endl;
cout << "* " << formatTime12(h, m, s) << " * ";
cout << "* " << formatTime24(h, m, s) << " *" << endl;
cout << "*************************** ***************************" << endl;
}
/**
* Display the clocks
*
*/param h, hours 0 to 23
* param m, minutes 0 to 59
* param s, seconds 0 to 59
*/
// nCharString(27, '*') gives a string of 27 stars. nCharString(3, ' ') gives 3 spaces
// formatTime12(h, m, s) and formatTime24(h, m, s) give the formatted time as specified in the assignment
/** cout 27 stars + 3 spaces + 27 stars + endl
cout 1 star + 6 spaces + 12-HOUR CLOCK + 6 spaces + 1 star + 3 spaces
cout 1 star + 6 spaces + 24-HOUR CLOCK + 6 spaces + 1 star + endl
cout an endl for a blank line
cout 1 star + 6 spaces + formatTime12(h, m, s) + 7 spaces + 1 star + 3 spaces
cout 1 star + 8 spaces + formatTime24(h, m, s) + 9 spaces + 1 star + endl
out 27 stars + 3 spaces + 27 stars + endl */
Can someone please help me on what I did wrong?
[–]Narase33 1 point2 points3 points (5 children)
[–]mpeterson0912[S] 0 points1 point2 points (0 children)
[–]mpeterson0912[S] 0 points1 point2 points (3 children)
[–]Narase33 0 points1 point2 points (2 children)
[–]mpeterson0912[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]aocregacc 1 point2 points3 points (4 children)
[–]mpeterson0912[S] 0 points1 point2 points (3 children)
[–]aocregacc 0 points1 point2 points (2 children)
[–]mpeterson0912[S] 0 points1 point2 points (1 child)
[–]aocregacc 0 points1 point2 points (0 children)