Question: Java Coding Only. Thank you. Write a java program that takes a list of numeric grades and then takes any single grade and displays what

Java Coding Only. Thank you.
Write a java program that takes a list of numeric grades and then takes any single grade and displays
what the rank of the single grade is compared to the list of grades previously entered. Here are the
specifications:
1. Accept a list of grades (Assume 30 max) of type integer. The list will be part of the command
line.
2. Get a single grade (from 0-100) of type integer.
3. Compare single grade to the list of grades and output what the rank of the single grade is.
4. Keep getting single grades from user until a negative (i.e.-1) grade is entered.
Example:
java ClassRank 759767878377
Enter Single Grade: 80
Class Rank =4
Enter Single Grade: 87
Class Rank =2(tie)
Enter Single Grade: -1
program terminated
Requirements:
1. Get the list of grades from the command line. Look at page 274 in text to see how to do
that. Convert list from string to integer.
2. Use a bubble sort to sort list of numbers. See link in this Moodle section for how to implement a
bubble sort.
3. If single grade matches a grade on the list, display (tie) along with the rank
Some Psudocode to help:
1) Read list of values from the command line and store them in an array Value: (745680958882) Position: 0-5. Create a Bubble Sort for the algorithm you can use. 3) Send the array to the bubble sort method and sort it in Descending order 4) Create a loop that gets single grades from the user. Exit the loop if its a negative number .
a. Get a single grade b. Start at position 0 c. Is array[position]>= single grade? d. If it is Is array[position]= single grade? Yes: Print Class Rank is Tied at (position+1) No: Print Class Rank is (position+1) Else Increment Position by 1 Position Value 074156280395488582 Position Value 095188282380474556 Get a single grade If single grade isnt negative, continue loop from step c.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!