Download presentation
Presentation is loading. Please wait.
1
Week 6 Computer Programming Gray 80 69 69 69, Calibri 24
Dark Red RGB , Calibri 54
2
Let’s make one final improvement on our program….
Find your program entitled Maths Quiz and open it. The program should have consisted of 5 questions The program should store the user’s name The program should also store the score Finally, the program tells the user whether they’ve got the question right or wrong. Let’s make one final improvement on our program….
3
The final score of the user
Score is 5 out of 5 Rank: Total Genius Score is 4 out of 5 Rank: Maths Wizard Score is 3 out of 5 Rank: Intermediate The final score of the user (after 5 questions) should fall into one of the following ranks. Score is 2 out of 5 Rank: Beginner Score is 1 out of 5 Rank: Noob
4
[name], you scored 1 out of 5. Your rank is NOOB
For example…. If the final score (after 5 questions) is 1 out of 5, the final score message will read: [name], you scored 1 out of 5. Your rank is NOOB or…. If the final score (after 5 questions) is 2 out of 5, the final score message will read: [name], you scored 2 out of 5. Your rank is BEGINNNER or…. If the final score (after 5 questions) is 5 out of 5, the final score message will read: [name], you scored 5 out of 5. Your rank is TOTAL GENIUS
5
To achieve this, we will once again use the If statement
if score == 1: print(user_name,', you scored: ', score,' out of 5. Your rank is: NOOB') if score == 2: print(user_name,', you scored: ', score,' out of 5. Your rank is: BEGINNER') . . . This code must be entered at the bottom of your program. As you can see in the above, there is no ‘else’ part. This is looked at in Year 11 Computing, but for our needs, 5 simple ‘if statements’ will help us achieve our objectives. Edit your program now so that it gives the user a ‘rank’ according to their score.
6
Save your Maths Quiz game.
NOTE! Not all possible scores have been ranked!! Once you’ve discovered what the missing score is, edit your program to ‘rank’ this using a message or your own choosing. Save your Maths Quiz game.
7
Hope you really enjoyed learning to program a computer…
…and hope you found PYTHON easy to learn! Next class, you will be doing a Controlled Assessment. You will be given the entire lesson to write a Python program which should solve a problem given to you by the teacher. Good Luck!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.