I'm doing a first year computer science course (I'm totally new to this) and we're currently on methods, I have to create two methods and a main program to run them.
I have the two methods created as posted below (I believe they are fine but feel free to point out if theyre not!) but I cannot seem to understand how to create a program to "test" them? since I can't reference any of the variables I used in the method outside of it! notes / my textbook don't seem to help
public static double smallest(double x, double y, double z) { double smallest = 0; double x; double y; double z; if (x < y && x < z) { x = smallest; } else if (y < x && y < x) { y = smallest; } else if (z < y && z < x) { z = smallest; return smallest; } }
public static double Average(double x, double y, double z) { double sum = x + y + z; double average = sum / 3; return average;
Any help on how to call the methods in I guess a main method to run them would be great!