java program part 2

Write a program in Java and run it in BlueJ according to the following specifications:

  • The program reads a text file with student records (first name, last name and grade) and prints them on the terminal window.
  • Then it prints three separate lists of excellent students, ok students and failure students according to their grades: excellent (> 89), ok [60,89], and failure (< 60).
  • Finally, the program prints the total number of students, their grade average, and the students with highest and lowest grade.
  • For example, if the input text file includes the following data:

John Smith 90

Barack Obama 95

Al Clark 80

Sue Taylor 55

Ann Miller 75

George Bush 58

John Miller 65

the program prints the following:

Students with excellent grades:

John Smith 90

Barack Obama 95

Students with ok grades:

Al Clark 80

Ann Miller 75

John Miller 65

Students with failure grades:

Sue Taylor 55

George Bush 58

Total number of students: 7

Average grade: 74.0

Student with highest grade: Barack Obama 95

Student with lowest grade: Sue Taylor 55

Requirements and restrictions:

  1. Define a class Student to represent the student information (student names and grade). Do NOT use public instance variables.
  2. Define and use an array of objects of class Student to store all student records read from the file.
  3. Define and use the following methods for:
    • Computing the average grade of all students.
    • Finding the students with highest and lowest grades.
    • Printing students in each grade category.
  4. Do NOT use the array of Students directly in the main method, all processing must be done by the methods described above using the array passed to them as a parameter.
  5. When you write your program
    • use proper names for the variables suggesting their purpose.
    • format your code accordingly using indentation and spacing.
    • use multiple line comment in the beginning of the code and write your name, e-mail address, class, and section.
    • for each line of code add a short comment to explain its meaning.

Extra credit (up to 2 points):

The extra credit will be given for extending the program to sort the array of students by grade and print the sorted array. Use the bubble sort algorithm as implemented in array.java.

"Is this question part of your assignment? We can help"

ORDER NOW