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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started