Ok so what are you having trouble on? We can't help you without knowing what you are struggling with, and no we won't give you the whole code.
If you are having trouble figuring out where to start here is some advice. Start small like figuring how to get the users input, and break the whole program into smaller manageable pieces. Then go through each and them pieces and add it to the code you already have.
Meaning he used your code for his homework lol. Also please don't delete your original post, people search this forum and your topic could have helped them find their answer to their question.