Dayaan M. answered 25d
Computer Science Graduate with Computer Engineering Coursework
The hint is pointing at the main thing to notice here. Up in the class you only declared Time(), which tells the compiler that a default constructor exists, but you never said what it does. That definition goes below, and it needs Time:: in front of the name so the compiler knows it belongs to this class.
The other thing to work out is what midnight actually means in this program, and the comment at the top tells you: the time is stored in 24 hour format with 0 hours meaning midnight. So midnight is hour 0 and minute 0, not 12.
Here is what goes between YOUR_CODE_BELOW and YOUR_CODE_ABOVE:
Time::Time() {
hour = 0;
minute = 0;
}
Notice there is no return type in front of it, not even void. That looks wrong the first time you see it, but a constructor never returns anything, so leaving the type off is exactly right. If you write void Time::Time() the code will not compile.
Also notice the constructor can assign to hour and minute directly even though both are private. That is because the constructor is a member of the class, so the private section is not hidden from it. Only code outside the class, like main, is kept out.
It is worth following what print() then does with those zeros, because the output is not what you might first expect. It takes hour % 12, which is 0, and because the code checks for that case it turns the 0 into 12. Then since hour is not 12 or more, it prints AM.
I compiled and ran it to be sure, and the program prints:
12:00 AM
So storing midnight as 0 and displaying it as 12 is the whole reason that twelveHour == 0 check exists in print(). Without it you would see 0:00 AM, which is not how a clock reads.