Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want to write a program in java that will ask users to enter a sequence of positive integers in a loop. If users enter

I want to write a program in java that will ask users to enter a sequence of positive integers in a loop. If users enter a non-positive number, the program should exit the loop and display the total number of positive integers entered, the average of those positive numbers, and the minimum and maximum values in the list. A sample run of the program will produce the following output. What I have far is:

Scanner kbd = new Scanner(System.in); int number; int maxnum; int minnum; int counter = 0; int total = 0; System.out.println("Please enter a postive interger."); number = kbd.nextInt(); if(number >0); { total = total + number; }

not sure what to do next, I know I may need to use an array somewhere.

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions