1 / 7

Computer Programming

Computer Programming. Week 6. 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.

tavia
Download Presentation

Computer Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Programming Week 6

  2. 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. Score is 5 out of 5 Rank: Total Genius Score is 4 out of 5 Rank: Maths Wizard Score is 3out 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. 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. 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!

More Related