Answered step by step
Verified Expert Solution
Question
1 Approved Answer
thank you!! /* PROBLEM 4 */ /*Given the following code, write two methods: - The first should simplify the input of each number (similar to
thank you!!
/* PROBLEM 4 */ /*Given the following code, write two methods: - The first should simplify the input of each number (similar to the MethodActivity) Use this to replace the redundant statements - The average method to calculate the average of the 3 numbers. Ensure that you comment the code statements and create the method JavaDoc comments. */ public class CodingAssignment2_P4 public static void main(String[] args) Scanner in = new Scanner(System.in); System.out.print("Input the first number: "); double x = in.nextDouble(); System.out.print("Input the second number: "); double y = in.nextDouble(); System.out.print("Input the third number: "); double z = in.nextDouble(); System.out.print("The average value is " + average (x, y, z)+" ")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