Question: using java thanks Q1. (a) Create a class named Household (save as Household.java) that includes a default constructor and two data fields (number of occupants

using java thanks

using java thanks Q1. (a) Create a class named Household (save as

Household.java) that includes a default constructor and two data fields (number of

Q1. (a) Create a class named Household (save as Household.java) that includes a default constructor and two data fields (number of occupants and annual income). And then create a driver program (save as TestHousehold.java) to test the class. 5 marks) Sample output for driver program: General Output Configuration Household 1 Nunber of occupants: Annual Income: 0.00 Values have been modified Nuber of occupants 6 Annual Income: 25000.00 Process completed Modify the default constructor for the Household class to set the occupants field to 1 and annual income field to 0. And then, run the driver program again. (b) I mark) (c) Create an additional overloaded constructor for the Household class. This constructor receives an integer argument and assigns the value to the occupant field. Change any needed statements to driver program to ensure that the overloaded constructor works correctly. Save and test the changes made. (4 marks) Create a third overloaded constructor for the Household class. This constructor receives two arguments, the values of which are assigned to the occupant and income fields respectively. Add any needed statements to driver program to ensure that the overloaded constructor works correctly. Save and test the changes made. (4 marks) (d)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!