// Erica Kane // 3 2.8 4 3.9 3 3.1 // Greenlee Smythe // 3 3.9 3 4.0 4 3.9 // Ryan Laveree // 2 4.0 3 3.6 4 3.8 1 2.8 // // The program reports the weighted GPA for each student along with the // max and min GPA.
2 8 0 7 4 12 0 2 1 8 7 1 7 4 4 6 79 5 8 5 1 2 7 4 3 2 4 2 7 0 4 5 4 10 2 0 275 93 1 5 4 5 6 8 1 2 6 -999 9 5 7 0 64 3 4 2 3 10 2 4 9 0 5 3 -36 9 1 0 6 2 2 1 6 6 1 3 8 6
public void recordPurchase(int numShares, double pricePerShare) { if (numShares < 0 || pricePerShare < 0) throw new IllegalArgumentException("negative shares or price"); // The argument values are acceptable myNumShares += numShares; myTotalCost += numShares * pricePerShare; }