The Durban City Council has decided to prioritize its spending on street maintenance according to the ages of the people who live in the street ... streets with older people will get extra funding, and homes with older people will get more attention in the street. This policy is an equitable one, unlike that in the bad-old-days of apartheid.
In order to implement this policy a computer program is needed. The first part of the program has to:
How many houses in the street? : 4 What is the next house number? : 1 What is the next house number? : 3 What is the next house number? : 4 What is the next house number? : 6 How many people live in number 1 : 4 What is the age of person 1 : 32 What is the age of person 2 : 28 What is the age of person 3 : 12 What is the age of person 4 : 8 How many people live in number 3 : 1 What is the age of person 1 : 84 How many people live in number 4 : 5 What is the age of person 1 : 78 What is the age of person 2 : 45 What is the age of person 3 : 23 What is the age of person 4 : 12 What is the age of person 5 : 10 How many people live in number 6 : 2 What is the age of person 1 : 22 What is the age of person 2 : 17 House 1 has a total age of 80 House 3 has a total age of 84 House 4 has a total age of 168 House 6 has a total age of 39 The street has a total age of 371