// post: Vector v is sorted in non-descending order.
Although the getSmallest method could be written recursively, it is preferable to either embed the getSmallest code as a while-loop in the code for the sort or to use code similar to the code on page 417 of the text.
After you have this program running correctly, make a back-up that can be submitted if your modifications do not compile and continue with the next part of the assignment.
For data, you are to use your daily quiz grades and homework grades. The key will be the quiz number in the form Q followed by the number (or homework number in the form HW followed by the number) and the value will be the grade you received on that quiz. In the Association the key should be a String object and the value an Integer object. You are to use the sort method to sort your quiz / homework grades into non-descending sequence. Since you are sorting by value in a key-value Association, the associated quiz / homework number will remain with the grade.
Finally, you are to
- compute the number of quiz / homework grades to average by the calculation
- int gradesToCount = numberOfGrades * 8 / 10;
- print quiz number (or homework number) and grade for each grade that is to be counted. (the best gradesToCount)
- Print the average of the grades printed in (2) and the associated letter grade.
- print the quiz / homework number and grade for each quiz that is *not* to be counted.
Notes:
(1) Add to your CLASSPATH
/home/lab210/public_html/structures
(2) Include " import structure.* " with the other import statements.
(3) If you are having trouble getting code which uses the Java supplied vectors to compile, add the following additional import line: " import java.util.Vector ; ".
(4) Name your program A2.java and submit using the handin command.
(5) Output is to begin with your name, your lecture section #, assignment number, date (either due or completed), and a short statement of what the problem does. All output should be carefully identified using English text. In addition to the ususal style standards (see lab #6), you are to include pre and post conditions on all methods.
If you are missing quiz grades or homework grades, you may ask for these values by email. A maximum of five grades will be provided free of charge. Additional grades or incorrect grades in the printout will be charged to you at the rate of one point each.