Question
I need to develop a JAVA appli/cation that prom/pts a user to create fi/ve students by en/tering a first name, last n/ame, and a single
I need to develop a JAVA appli/cation that prom/pts a user to create fi/ve students by en/tering a first name, last n/ame, and a single test score bet/ween 0 and 100. After the stu/dents have been entered, sort the students by test sc/ore using the selection so/rt method in descending order (highest to lowest) and print the /list of students to the Co/nsole. I have the Sorting CLASS prepared to sort the students, demonstrating polymorphism with interfaces, and develop at least two other classes (in addition to the driver class) for this assignment.
////////CLASS SORTING////////
public class Sorting {
public static void selectionSort (Comparable
for (int index = 0; index < list.length-1; index++) { min = index; for (int scan = index+1; scan < list.length; scan++) if (list[scan].compareTo(list[min]) < 0) min = scan;
temp = list[min]; list[min] = list[index]; list[index] = temp; } }
public static void insertionSort (Comparable
while (position > 0 && key.compareTo(list[position-1]) < 0) { list[position] = list[position-1]; position--; } list[position] = key; } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started