Purchase Solution

Java: Reading Integers, and Computing Totals and Averages

Not what you're looking for?

Ask Custom Question

Write a Java program that will read integers and find the total and average of the input values, not counting zeros.

My program must end with the input zero.

I have to display the average as a floating point number.

The program must also find the largest and smallest value. It also must find the count of how many entries were entered by the user not including the zero to exit the programs.

If input is 50, 55, 60, 0, my output should be:
The total is 165.
The average is 55.0.
The largest value is 60.
The smallest value is 50.
The number of entries is 3
The input and output must use JOptionPane dialog and display boxes.

Purchase this Solution

Solution Summary

This solution provides guidelines on writing a Java program that will read integers and calculate the averages and totals of input values (see the attachment).

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.