The Student Room Group

Algorithm help!

Specification:
Kevin's plumbing shop sells 2 products, copper pipes and radiators. Kevin's is offering 10% discount if a customers' total bill is more than £100. Assume each customer buys quantities of both products.

Produce a revised algorithm for the bill calculations.

Examples:
a. Sandara buys 6 metres of piping at £5 per metre and 3 radiators at £20 each.
Her pipes cost 6 * £5 = £30
Her radiators cost 3 * £20 = £60
Total bill = £90 so no discount - needs to pay £90.

b. Eli buys 20 metres of piping at £4 per metre and 4 radiators at £15 each.
His pipes cost 20 * £4 = £80
His radiators cost 4 * £15 = £60
Total bill = £140 so discount of £14 is given.
Eli needs to pay £140 - £14 = £126.

A similar equation is to be solved in my GCSE ICT test so any help will be appreciated and if you can explain it that will really be an added bonus. Thank you.

Quick Reply

Latest

Trending

Trending