> I'm afraid I can't. I tried but failed. I have to do this homework but I'm beginner.
So you're saying you've never ever written a program before, and this is your absolutely first homework assignment on the course that started this week?
At least post your best failure to date, then we can help you fix your knowledge gaps.