Oh come on!
You've been here often enough, asked enough questions, had syntax errors explained toi you before.
What do you think
reached end of file while parsing
It means it's expecting something - a close curly bracket - and it didn't get it.
And a trivial look at the code says where you forgot it.
Hint: What - exactly - are you expecting to do if the user starts by not entering "Y" or "N"? Did you want to ask for his name?