1. /** Gives the employee a raise in salary. The raise is either a standard amount (2%) or adds an additional bonus raise (5% combined). @param isGoodEmployee tells if the employee should get the larger raise. */ 2. public class SquareTester { public static void main(String[] args) { Square sq = new Square(10); //This line was added System.out.println(sq.getArea()); System.out.println("Expected: 100"); // grow and move back to original center sq.grow(3); //This line was added. sq.translate(-10, -10); //This line was added. System.out.println(sq.getCenterX()); System.out.println("Expected: 5"); System.out.println(sq.getCenterY()); System.out.println("Expected: 5"); System.out.println(sq.getArea()); System.out.println("Expected: 900"); } } 3. public void bet(double wager, double winProbability) { if(winProbability < .5 || winProbability > 1) return; double random = Math.random(); if (random < winProbability) funds = funds + wager; // The gambler won else funds = funds - wager; // The gambler lost } 4. public boolean hasWishesLeft() { return wishes < TOTAL_WISHES; } 5. a) None neeeded. b) String getLetterGrade() would first use getAverageScore(), and classify the returned number into a letter grade by the given values (9.0 and up is an A, etc.). c) No other changes are needed. 6. I give the answer below, broken into separate method calls, with the values staggered by time even within one method call. After that, I give the simplified answer which is also acceptable. Robot turnLeft moveBackward x 0 1 y 0 0 dx 0 -1 dy -1 0 newDx -1 X Simplified version: x 0 1 y 0 0 dx 0 -1 dy -1 0 newDx -1 X 7. The paintComponent method is given below. Note, it is nicer to put the note on top of the staff, but I will also take the staff over the note. public void paintComponent(Graphics g) { // Recover Graphics2D Graphics2D g2 = (Graphics2D) g; // Change to blue g2.setColor(Color.BLUE); // Make and draw lines Line2D.Double staff = new Line2D.Double(5, 20, 100, 20); g2.draw(staff); staff = new Line2D.Double(5, 30, 100, 30); g2.draw(staff); staff = new Line2D.Double(5, 40, 100, 40); g2.draw(staff); staff = new Line2D.Double(5, 50, 100, 50); g2.draw(staff); staff = new Line2D.Double(5, 60, 100, 60); g2.draw(staff); // Change back to black for the note. g2.setColor(Color.BLACK); // Construct and draw one note base Ellipse2D.Double base = new Ellipse2D.Double(10, 30, 10, 10); g2.fill(base); // Construct and draw the stem Line2D.Double stem = new Line2D.Double(19, 10, 19, 35); g2.draw(stem); }