Firstly this is not a homework question. I am practicing my knowledge on java. I figured a good way to do this is to write a simple program without help. Unfortunately, my c
Your main method needs to be declared like this:
public static void main(String[] args) {..}
Furthermore, it seems like you are only supplying one argument to your all your arithmetic methods (addition, subtraction etc), although they require two.
public int addition(int x, int y);
Can not be called with addition(operands)
, that is only one argument, and the argument is of the wrong type (the method needs two int
, you give it a Scanner
). The same goes for all those methods. You need to extract the int
s from the Scanner
. You can do that with Scanner.nextInt()
.