Notes: for P10.3, you need to deal with the fact that the Square class receives the coordinates of the center of the square, but the setLocation method of the Rectangle class sets the x and y coordinates of the upper-left corner.

Here is sample code you can use to handle all of the I/O in the output window:
Scanner sc = new Scanner(;
System.out.print("Center x? ");
int centerX = sc.nextInt();

Also, import the Scanner class: import java.util.Scanner;

For P10.6, I made the Worker class abstract (header line: public abstract class Worker) because the Worker class doesn't have a specific computePay method. You can also make the computePay method abstract: public abstract double computePay(int hours). I wrote setSalaryRate and getSalaryRate methods. I put main() inside the Worker class.

Also for P10.6, the HourlyWorker and SalariedWorker classes each have a constructor that sets their salary rate. Then the method computePay calculates their pay. If the HourlyWorker earns $25/hour and the SalariedWorker earns $40/hour, here is sample output:

Hourly worker pay for 40 hours: $1000.0
Hourly worker pay for 50 hours: $1375.0
Salaried worker pay for 40 hours: $1600.0
Salaried worker pay for 50 hours: $1600.0