Welcome to the Ranch. It is difficult to help without knowing what goes wrong, and please put your code on the posting if possible. I cannot run your code because the hsa.Console class is not available.
This is a very interesting problem and quite common as a homework assignment for beginning programming courses. What problems have you encountered in writing this program? What is "not working" at the moment? Does your code compile? If not, what are the COMPLETE compiler errors? If it does compile, what happens when you run it? How does this differ from what you expect?
If you can provide some insight to what is happening, you might find that you solve the problem yourself. If not, then we can provide some hints and explanations to get you started in the right direction.