Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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[] list) { int min; Comparable temp;

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[] list) { for (int index = 1; index < list.length; index++) { Comparable key = list[index]; int position = index;

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

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

Students also viewed these Databases questions

Question

OSPF uses what type of routing algorithm?

Answered: 1 week ago

Question

What do you mean by dual mode operation?

Answered: 1 week ago

Question

Explain the difference between `==` and `===` in JavaScript.

Answered: 1 week ago