You're right, it should work. I don't know why it doesn't work here but when I copy/paste your code and compile it with g++ myself, then it works.
Anyway, I was able to get your code to work by merging lines 7 and 8:
using namespace std;
string movieTitle = "Pizza Time";
cout << "Hello World" << endl;
cout << "My favorite movie is " << movieTitle << endl;
That seems to work for me.