Harry Potter Sorting Hat

cpp code for Harry Potter Sorting Hat code for reference. Please go through it and make changes if you find any errors or have a better/cleaner way of writing this code.

Nice job! Though there are a couple things I notice.

First you have your github file as a markdown README.md. Though it is good for a repository to have a readme file, it would probably be better to have your source code with the right file extension, .cpp in this case.

Second is the results of your first question. They aren’t being saved to the variables, just printed, so they don’t effect the end result.

On the side, you don’t have any handling for invalid answers, but I don’t believe you will have learned about loops yet at this point in the course so no harm there. Might be worthwhile to come back to though when you learn more.

1 Like

Thank you so much for your input I really appreciate it! :smiley:
I am still learning and trying to improve my skills.

1 Like

I figured it out it was that I had no Breaks in my switch. added those and it worked flawlessly. here is my Replit:

You can play it at that link.