This is clearly a homework assignment. While we can assist you on homework assignments, we cannot just write the code and give it to you.
Please start by posting the errors themselves. Are the compilation errors or logical errors? If they are logical errors, post the input provided, the output received, the expected output.