Challenge 21 – Mega 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 program to tell the sales assistant which voucher to give the customer. Save this as: megasale Challenge 22 – Happy Message Write a program that gives a message depending upon how happy they say they are. You could get the user to rate how happy they feel on a scale between 1 and 10. If the reply is 3 or less it gives one message. Between 4 and 7 (including these numbers) they get another message. 8 and above they get a different message. Try to make the messages ones to make them happy all day long! Save this as: Happy message Challenge 23 – Mobile Phone Costs You want to see how much a mobile phone will cost. There are charges for sending pictures (£0.35), for texts (£0.10) and for data (£0.05 for 1MB). Write a program that asks the user for how many pictures, texts and data they would use each month. It should then calculate a total bill for the month. If the total comes to more than £10 they would be better on a contract. Get the program to give them this advice. Save this as Mobile Phone Costs Harder Data is charged at £2.50 per 500MB. So even if only 2MB are used you still pay for £2.50. What we want to do is be able to round-up a number (the function round () rounds up or down). You will need to: import maths to get more maths features and use: math.ceil(number) – to roundup a number to the next integer Can you figure out what the calculation is to make this work? Challenge 24 – Secret password Make a program where the user has to enter a secret password to use the program. The program could be one you’ve already written, or make it display a message when they have got the password correct.
Challenge 21 – Mega 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 program to tell the sales assistant which voucher to give the customer. Save this as: megasale Challenge 22 – Happy Message Write a program that gives a message depending upon how happy they say they are. You could get the user to rate how happy they feel on a scale between 1 and 10. If the reply is 3 or less it gives one message. Between 4 and 7 (including these numbers) they get another message. 8 and above they get a different message. Try to make the messages ones to make them happy all day long! Save this as: Happy message Challenge 23 – Mobile Phone Costs You want to see how much a mobile phone will cost. There are charges for sending pictures (£0.35), for texts (£0.10) and for data (£0.05 for 1MB). Write a program that asks the user for how many pictures, texts and data they would use each month. It should then calculate a total bill for the month. If the total comes to more than £10 they would be better on a contract. Get the program to give them this advice. Save this as Mobile Phone Costs Harder Data is charged at £2.50 per 500MB. So even if only 2MB are used you still pay for £2.50. What we want to do is be able to round-up a number (the function round () rounds up or down). You will need to: import maths to get more maths features and use: math.ceil(number) – to roundup a number to the next integer Can you figure out what the calculation is to make this work? Challenge 24 – Secret password Make a program where the user has to enter a secret password to use the program. The program could be one you’ve already written, or make it display a message when they have got the password correct.