Hello I'm a beginner java student and can't figure out what I'm doing wrong.
Write the following methods and provide a program to test them
A. double smallest(double x, double y, double z), returning the smallest of the arguments
B. double average(double x, double y, double z), returning the average of the arguments
this is what I have...
import java.util.Scanner; public class SmallestAndAverageCh5 { public static main(String[] args) { Scanner in = new Scanner(System.in); System.put.print("Please enter three different numbers between 1 and 10:"); double x = in.nextDouble(); double y = in.nextDouble(); double z = in.nextDouble(); double smResult = smallest; double avgResult = average; System.out.print("The smallest value you entered is " + smResult); System.out.print("The average value of the numvers you entered is " + avgResult); } public static double smallest(double x, double y, double z) { if (x < y && x < z) { return x; else if (y < x && y < z) {return y; } else (z < x && z < y) {return z; } } } public static double average(double x, double y, double z) { double average = (x + y + z)/3; return average; } }