As the title says I need help with writing a program that will do the exact following output
Enter hours: 145
Result: Sunday, 1 am
PROGRAM ENDS
the range in ours has to be 0-167...and ofcourse if you inter 0 it will be monday 12 am.... enter 12 for the hours it will display Monday, 12 noon. thank you in advance,
I honestly have nothing at the moment, I have missed a lot of this class because my wife and I just had a child. I do not even know where to begin with this. I don't know if it is just a function, a while loop? array? I've been able to walk myself through the last ones, but the book is of no help on this one.
elseif (hours>0 && hours< 12) cout << "a.m.";
Now it's just the logic that is wrong; what if the time is 00:13? That should be a.m., right? But your code would give it p.m. Instead, it should be elseif (hours>=0 && hours< 12) cout << "a.m.";
constint Monday = 0-23
This ascribes the value minus 23. I suspect you don't mean that. An int can hold one number. Just one.
Tuesday = 24-47
This gives the variable Tuesday the value minus 23 as well. I think you need to go back and learn before you start using.
I get the feeling that you're not coding in C++, as such, but you're coding in some other language that permits such constructs and trying to force it into C++ syntax. What's your previous programming language experience?