Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The third pic is the starting code, I just need to finish it. We want to find the average of three positive numbers (doubles). Consider

image text in transcribed
image text in transcribed
image text in transcribedThe third pic is the starting code, I just need to finish it.
We want to find the average of three positive numbers (doubles). Consider the following class (which is not complete) Program finds the minimum of import java.util.scanner public class Labs itive numbers find the minimum of three numbers public static void main(String args) f Scanner input new Scanner (System.in)i double one / first number double two /I second number double three // third number System.out. Enter a positive number or type Q to terminate")i while (true) one, getInput (input remaining inputs and is Write code to get negative tered Write code to display the minimum the three il floating-point numbers / /end while // end main // the minimum method determines the smallest of three numbers /1 complete the header for the minimum method /1 that takes three double parameters and returns a double public static ktypo> minimum() code to compute and return the minimum of three numbers ) // end method minimum /l the gotInput method prompts the user for input and /l returns a number entered by the user or -1 if a negative number // or if something else is entered. public static double getInput (Scanner input) // Add code to prompt and return the user's input l end method getInput Complete the getInput method to prompt the user and return the user's input or a -1 if he enters something other than a number Add the appropriate code in the while loop to input the remainder of the input data using the getinput method or exiting the program whenever a negative value is returned 1. 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Window Functions For Data Analysis And Beyond

Authors: Itzik Ben Gan

2nd Edition

0135861446, 978-0135861448

More Books

Students also viewed these Databases questions