Quote Originally Posted by The_Doctor

Its not my design. For my coursework I was given a design and told to create the code for it and to test it.
What was the exact design ? It can't be very long considering it's only one method, so you might as well share it with us

Since you're doing a relatively simple program, I'd avoid using input commands in the method, and would instead either decalre a seperate method for getting the inputs or just put it in the main code, but that might not work and is just a personal preference I assume (I'm not really experienced either).

Do listen to Sasaki's comment though, you only need to 'give' a method variables that have a specific value, like

public double multiply(double x,double y){return x*y;}

if you're going to input them within the method you can declare them als local variables.