Main problem is that you're using both getline() and cin>>. Mixing them up gives problems, I recommend you to always use getline(). See http://www.cplusplus.com/forum/articles/6046/
And you have to put an endline before "Hours:" and a second endline at the end of the for-loop to get the exact same output as the sample.
Most of the problem is that cin >> hour; leaves whitespace -- in this case the newline character, which is then read by the next iteration of cin.getline(cname, 5); as a completed line, since it sees the newline character as the end of input.
In order to get around this problem, you need to clear the newline character after cin >> hour. Normally, this is done with cin.get();
1 2
cin >> hour;
cin.get();
That will resolve some of the trouble you're having. There are other troubles with this program that this solution does not address, but as long as you input exactly what your program is expecting, you should be able to limp along.