Assume that grades only include A, B, C, F and in progress and all courses have...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Assume that grades only include "A", "B", "C", "F" and "in progress" and all courses have the same credits (one credit). Further assume that grades are non- empty, and first-semester Students do not have any grade yet (all their current grades are "in progress." Signature of the class needs to be figured out and extra helper functions can be useful if needed. public class Student { final String name; final String ID; //ID is a String instead of integer final ArrayList Grades; //constructor public Student (String name, String ID, ArrayList Grades) { } public ArrayList getGrades () { } return Grades; public double getGPA () { //your implementation } 1. Implement the getGPA() method to compute the GPA of each Student. The numerical grades of "A", "B", "C", and "F" are 4,3,2, and 0 respectively. Do not count the courses "in progress" since grades are not assigned yet. For first- semester Students (all grades are in progress), return -1 2. Write a class Comparator GPAOrdering to sort Students in the descending order of GPA. If Students have the same GPA, further sort them in the ascending order of number of Fs that students have, i.e. Students with less Fs appear before Students with more Fs in ordering Assume that grades only include "A", "B", "C", "F" and "in progress" and all courses have the same credits (one credit). Further assume that grades are non- empty, and first-semester Students do not have any grade yet (all their current grades are "in progress." Signature of the class needs to be figured out and extra helper functions can be useful if needed. public class Student { final String name; final String ID; //ID is a String instead of integer final ArrayList Grades; //constructor public Student (String name, String ID, ArrayList Grades) { } public ArrayList getGrades () { } return Grades; public double getGPA () { //your implementation } 1. Implement the getGPA() method to compute the GPA of each Student. The numerical grades of "A", "B", "C", and "F" are 4,3,2, and 0 respectively. Do not count the courses "in progress" since grades are not assigned yet. For first- semester Students (all grades are in progress), return -1 2. Write a class Comparator GPAOrdering to sort Students in the descending order of GPA. If Students have the same GPA, further sort them in the ascending order of number of Fs that students have, i.e. Students with less Fs appear before Students with more Fs in ordering
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Does a womans chance of suffering from postpartum depression vary depending on the number of children she already has? To find out, a researcher collected random samples from four groups of women:...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Suppose that In Example 18.6 the electrical firm does not have enough prior information regarding the population mean length of life to be able to assume a normal distribution for p. The firm...
-
Nitrogen at 200oC, 300 kPa is in a piston cylinder, volume 5 L, with the piston locked with a pin. The forces on the piston require a pressure inside of 200 kPa to balance it without the pin. The pin...
-
Peek-a-Boo Veach, a U.S. citizen, estimates that a diversified portfolio of Norwegian common stocks has a standard deviation of 24%. Peek-a-Boo also estimates that the standard deviation of the U.S....
-
The United States and Canada are two of only 33 countries that have jus soli, the right to citizenship of any individual born on their soil. Why do you think this right is so limited, and do you...
-
A colleague tells you that he can get a business loan from the bank, but the rates seem very high for what your colleague considers a low-risk loan. a. Give an adverse selection explanation for this,...
-
Presented below is information related to the Annandale Division of Lumber, Inc. Contribution margin $ 1 , 2 1 1 , 9 0 0 Controllable margin $ 8 9 5 , 1 8 0 Average operating assets $ 4 , 0 6 9 , 0 0...
-
Zero Cold Storage operates a system of refrigerated warehouses across Canada and the United States. During June 2014, the Ontario Securities Commission filed charges under the Ontario Securities Act...
-
Consider a bond with a face value of \(\$ 1,000\) and coupon payment at the end of each period \(k\) given by a rate \(c_{k}=\max \left[6 \%-r_{k}, 0 ight]\), where \(r_{k}\) is the short rate for...
-
Problem 10 in Chapter 4 asked you to consider the current stance of monetary policy. Here, you are asked to do so again, but with the additional understanding of monetary policy you have gained. Go...
-
Let's assume Bethesda Imaging, Inc. has $\$ 30$ million cash on the balance sheet. Executives at the annual board meeting passed on any of the investments from the prior year, and correctly...
-
Which of the alternatives described below is more economical if (a) the assets are depreciated on a straight-line basis, (b) the tax rate is $40 \%$, and (c) the after-tax MARR is $6 \%$ ? 1. How...
-
A deep reactive ion etching (DRIE) system with an expected life of 10 years was purchased 5 years ago for $\$ 175,000$ and currently has a market value of $\$ 92,500$. Predicted operational costs the...
-
Childrens Hospital in Boston, Massachusetts, has long been considered an outstanding medical center specializing in the diagnosis and treatment of pediatric problems. This facility is linked...
-
Which property determines whether a control is available to the user during run time? a. Available b. Enabled c. Unavailable d. Disabled
-
The beam is constructed from two boards fastened together at the top and bottom with three rows of nails spaced every 8 in. If each nail can support a \(300-\) lb shear force, determine the maximum...
-
The beam is constructed from two boards fastened together at the top and bottom with three rows of nails spaced every \(8 \mathrm{in}\). If an internal shear force of \(V=800 \mathrm{lb}\) is applied...
-
The beam is fabricated from two equivalent structural tees and two plates. Each plate has a height of 6 in. and a thickness of 0.5 in. If a shear of \(V=50\) kip is applied to the cross section,...
Study smarter with the SolutionInn App