• ### Question

• Widgets cost £9.99 each.

Write a program that asks the user how many widgets they would like to buy.

Users get a discount depending how many widgets they buy:

1 – 5                       =             5%

6 – 9                       =             7.5%

10 or over           =             10%

The program should calculate and display:

1. The cost before discount
2. The amount of discount
3. The amount the user has to pay

How do I work this out???

Wednesday, April 18, 2018 10:53 PM

• In pseudo code:

cost=amount*9.99

if amount<6  discount=0.05

elseif amount<10 discount=0.075

else discount=0.10

discountamount=cost*discount

topay=cost-discountamount.

Try to write this in SmallBasic. If you run into trouble, ask again.

Jan [ WhTurner ] The Netherlands

Thursday, April 19, 2018 8:16 AM

### All replies

• In pseudo code:

cost=amount*9.99

if amount<6  discount=0.05

elseif amount<10 discount=0.075

else discount=0.10

discountamount=cost*discount

topay=cost-discountamount.

Try to write this in SmallBasic. If you run into trouble, ask again.

Jan [ WhTurner ] The Netherlands

Thursday, April 19, 2018 8:16 AM
• @ MixedTaste

If you need more help perhaps post the code you have so far with details of bits that need help

Sunday, May 6, 2018 4:18 PM