FIrst off, indent and space yoru code correctly - double spacing it doesn't make it look "bigger", "better", or "more complete" it just makes it harder to read...
And indentation that suddenly goes flat to the left makes it again harder to read - and look like you couldn't be bothered as well, as most IDE's do a damn good job of indenting for you as you go along ...
But "What I have tried" shows exactly what *you* have tried: nothing at all so far and that you haven't even understood the basic framework code your teacher gave you ... stop throwing random code together and hoping that it'll work: that won't happen. Instead, sit down and think about the problem you have been set.
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.
So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
If you are having problems getting started at all, then this may help:
How to Write Code to Solve a Problem, A Beginner's Guide[
^]