i am also a beginner but i help you ...
First thing you should do with this code is
1- Create Scanner Object to read input like Scanner input=input.(member function which you need in ur case)
...