Parameters - /* / Parameters.java / / Illustrates the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************** // Parameters.java // // Illustrates the concept of a variable parameter list. //******************************************************** import java.util.Scanner; public class Parameters { //----------------------------------------------- // Calls the average and minimum methods with // different numbers of parameters. //----------------------------------------------- public static void main(String[] args) { double mean1, mean2, mean3, mean4; int min1, min2, min3, min4; Scanner scan = new Scanner (System.in); mean1 = average(42, 69, 37); mean2 = average(35, 43, 93, 23, 40, 21, 75); mean3 = average(13); mean4 = average(); min1 = minimum(42, 69, 37); min2 = minimum(35, 43, 93, 23, 40, 21, 75); min3 = minimum(13); min4 = minimum(); System.out.println ("mean1 = " + mean1 + " and min1 = " + min1); System.out.println ("mean2 = " + mean2 + " and min2 = " + min2); System.out.println ("mean3 = " + mean3 + " and min3 = " + min3); System.out.println ("Return value of average for an empty parameter list is "
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Parameters - /* / Parameters.java / / Illustrates the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online