Question 11

AQA Computer Science November 2020 Paper 1 (7517/1)A level8 marks

On the specification

11.1
4.1 Fundamentals of programming3.1 Fundamentals of programming
11.2
3.3 Systematic approach to problem solving
Question text

11 This question extends the functionality of the simulation by adding a new type of household, an affluent household, that eats out considerably more often than other households. What you need to do Task 1 Create a new class called AffluentHousehold that inherits from the Household class. The constructor for this new class should make a call to the constructor of the Household class and then set the value of ChanceEatOutPerDay to 1 Task 2 Modify the AddHousehold method in the Settlement class so that it creates an AffluentHousehold object instead of a Household object if the randomly- generated value for X is less than 100 Task 3 Test that the changes you have made work: • run the Skeleton Program • choose to use a normal size settlement • choose to use the default companies • then choose the menu option to display the details of the households and check that there is a mixture of both types of household in the settlement. Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 11.1 Your PROGRAM SOURCE CODE for the amended method AddHousehold and the new class AffluentHousehold. [7 marks] 11.2 SCREEN CAPTURE(S) showing the requested test. [1 mark]