Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a JAVA program to read in positive integers until a negative value is entered, then it processes the values except for the last negative

Write a JAVA program to read in positive integers until a negative value is entered, then it processes the values except for the last negative value and displays the largest value, smallest value, and the average of the entire values.

Ex)

Output:

Please enter a positive integer, or -1 to quit.

Input: 1

Output:

Please enter a positive integer, or -1 to quit.

Input: 2

Output:

Please enter a positive integer, or -1 to quit.

Input: 3

Output:

Please enter a positive integer, or -1 to quit.

Input: 4

Output:

Please enter a positive integer, or -1 to quit.

Input: -1

Output:

For the 4 numbers you entered

the largest value = 4

the smallest value = 1

and the average is = 2.5

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago