Question: Part 1: Write a program (name it Numbers.java) that has the following methods. public double smallest(double x, double y, double z), returning the smallest of

Part 1: Write a program (name it Numbers.java) that has the following methods.

public double smallest(double x, double y, double z), returning the smallest of the arguments

public double average(double x, double y, double z), returning the average of the arguments

public boolean allTheSame(double x, double y, double z), returning true if the arguments are the same, false if they are not

public boolean allDifferent(double x, double y, double z), returning true if the arguments are all different, false if they are not

public boolean sorted(double x, double y, double z), returning true if the arguments are sorted with the smallest coming first, false if they are not

Part 2: Write a program that will create an instance of the class Numbers and will call the methods of the class Numbers using that instance. Print the returned values to the screen with appropriate user interface for example: Smallest: 1.2 Average: 3.3 All Same: true All Different: false Sorted: 4 5 16

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!