Purchase Solution

Example Java program using arrays and sort algorithms

Not what you're looking for?

Ask Custom Question

Write a program that allows the user to enter students' names followed by their test scores and output the following information(assume that the maximum number of students in the class is 50):

a. Class average

b. Names of all the students whose test scores are below the class average, with an appropriate message

c. Highest score and the names of all students have the highest score

example of the data.txt file format:

AAA 85
BBB 90
CCC 100
DDD 85
... ...
... ...

Purchase this Solution

Solution Summary

This solution provides an example Java program that uses an array to store data and sorts the array.

Solution Preview

This solution shows how to use an array in Java and how to read data from a file. We use two Java classes. The first class, ScoreData, is just for storing the name and score values for a particular data item. The class constructor takes the name and score for a particular
item. There are accessor methods to get the name and score out.

Most of the work is done in the Scores class. This class contains an array of ScoreData items. The array is loaded with the ...

Purchase this Solution


Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Basic Networking Questions

This quiz consists of some basic networking questions.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

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.