I think I did this right....

This isn't really right. The answer has to do with dynamically allocated variables. I think you should look up the answers to this question and the previous one before the midterm.