1. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Jan 2014
Posts
5
Rep Power
0

Sale

A local shop is having a promotion. If you spend over £10 you will get a £1 voucher to spend next time you come in the store. If you spend over £20 you get a £3 voucher.
Write a programme to tell the sales assistant which voucher to give the customer.
2. Try to write the program without < and without > operators. I think I can. Hint: use the decimal module.
3. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Jan 2014
Posts
5
Rep Power
0
I haven't learned 'decimal module' so could you please show me how to do so? as i can't seem to find the correct thing towards this question over internet.
4. I will not show you how to use the decimal module because the solution I have in mind is brain dead.

You must show some work and ask a specific question for assistance at this web site. Even if all you can manage is a piddly flow chart.

• codergeek42 agrees : Well said...it's hard to help those who won't help themselves.
5. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Jan 2014
Posts
5
Rep Power
0
Code:
```print 'Welcome to the Mega Sale'
spend = input('How much have you spend today in the mega sale?')

if spend >10:
print 'You earned a £1 voucher'

if spend > 20:
print 'You earned a £3 voucher'

if spend < 10:
print 'You earned no voucher'```
This is how far i got to, i encounter this problem where i type '25' say, i get the £3 voucher and £1 voucher which is not what i want.
6. if .. elif .. elif .. else

if elif executes the first block of code that meets a condition.

Code:
```if spend > 20:
print 'You earned a £3 voucher'

elif spend >10:
print 'You earned a £1 voucher'

else:
print 'You earned no voucher'```
7. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Jan 2014
Posts
5
Rep Power
0
Thanks, I'll take note of this.