Your teacher did not tell me about those methods,either.
But your teacher told you that use the nextInt() method of java.util.Scanner
So I go to google ,type java.util.Scanner, and I found many pages.
For example: [url=]Scanning Text With java.util.Scanner and Covariant Return Types [/url]...

How to draw the point: your teacher already provided you files. You need to read those files and find out how to do it.
If you still have problem after you have read it, you can post your question with what you have read.
But you need to read it first.