Final answer:
To create the Jobs class, define data fields and getter/setter methods. Instantiate two Job objects in the DemoJobs class and print the total fee for each.
Step-by-step explanation:
To create the Jobs class, you will need to define the following data fields: description, time in hours, hourly rate charged, and total fee. You should include getter and/or setter methods for each field. The total fee field should be read-only and calculated based on the hourly rate and time in hours.
For example, if the description is 'wash windows', the time in hours is 3.5, and the hourly rate is $25.00, the total fee would be $87.50. In this example, job1 is created using the no-argument constructor and then setting each property, whereas job2 is created directly with the specified constructor. The getTotalFee method, which is read-only, calculates the total fee for the job. This meets the requirement that the Total fee is a read-only field.
In the DemoJobs class, instantiate two Job objects, one using the no-argument constructor and the other using the constructor that takes description, time, and hourly rate as arguments. Print the total fee for each object to demonstrate their usage.