A doctor might advise a patient to gain weight, but not by eating that sort of junk. I call BS on that part of the story.
I tried everything I could think of to put on weight. Junk food worked.