2020 - Brexit will half the probabilities of households eating out

From TRCCompSci - AQA Computer Science
Revision as of 17:15, 14 December 2019 by Admin (talk | contribs) (Adding new function into Household class)
Jump to: navigation, search

Adding new function into Household class

In the household class find the following:

        public double GetChanceEatOut()
        {
            return chanceEatOutPerDay;
        }

This returns the chance of eating out per day, we are going to create a method to change the value instead. So below this enter:

        public void ChangeChanceEatOut(double change)
        {
            chanceEatOutPerDay *= change;
        }