Presentation is loading. Please wait.

Presentation is loading. Please wait.

Story time Task 5 Computer Programming Gray , Calibri 24

Similar presentations


Presentation on theme: "Story time Task 5 Computer Programming Gray , Calibri 24"— Presentation transcript:

1 Story time Task 5 Computer Programming Gray 80 69 69 69, Calibri 24
Dark Red RGB , Calibri 54 Story time

2 Why program? Click for an Idea!

3 Task Aims: T1 : Writing out text using 3x “ to write on multiple lines T2 : Using elif to extend conditional statement T3 : Understanding different error messages when debugging T4 : Importing the Time module T5 : Making your own function by defining with def T6 : Flowchart of your adventure so far T7 : Adding to the adventure T8 : Evaluating your progress

4

5 Story time What story can you tell? It should be creatively written Spelling, grammar & punctuation will be a strong part of this assessment!

6 T1 Adventure Game Setting the scene: Where will it take place? Task 1
Open Python and create a beginning for your Adventure: Where will it take place? When will it Happen? Who will be the hero What will be the Drama Will there be mild peril? Q:What does ””” do to the string?

7 Learning Objectives Identify...
...that if and else are limited to only two outcomes Describe... ..how elif can be used to extend options Explain... ...in your code how if , elif and else can work Apply... ...a range of conditional statements Link... ...your python code into a well written adventure

8 But what if you want more than one option?
Last time, you entered in this program called MathsQuiz.py But what if you want more than one option?

9 …ELIF It allows you to extend your choices to more than just the two available with if else. Now you can have: if ...junk Food..."mmm keep it coming“ elif ...Doughnuts..."arggg drooool" elif...Sweets..."Its not doughnuts but mmmm" elif...Duff..."Mhmmmmm" elif (as many as you need - which for Homer is a lot!) else..."I can't eat this!!!"

10 T2 If…elif…else TASK 2: Copy out the code exactly as you see it, change the content to fit your story but watch out for these mistakes: Define the Choice variable at the start Use == and : on each if, elif and else statement Only 1 indentation for each of the print functions under a conditional statement

11 Code close up The variable we will use is called ‘choice’ define this first at the beginning Indentation shows “ownership” so the print function belong to the elif statement

12 T3 Debugging? There are 3 main errors made by programmers (that is us!) Syntax Errors – e.g.. silly typing errors Run-time Errors – e.g.. it may run but crashes at some point Logical Errors – e.g.. getting the code to run but it does something different This is probably the most common error you will get: a Trace back error message- its saying that the variable is not defined – did you assign choice=input properly? TASK 3: Run you program, If it comes up with an error message read it carefully – Is it telling you its a EOL ( end of line) Syntax error? Perhaps you forgot a colon at the end of a line of code?

13 Sign up at Codecademy and start this python course:
This will be YOUR way of extending YOUR learning either in lesson or at home!

14 Hardware & Software Click
>>>What is the difference between Software & Hardware? >>>Why do we have to program computers?

15 T4 Importing Time? TASKS: Keep the structure the same
You have used the import feature of python with the Turtle work: it’s a library. A library or module always gets called at the start of your code TASKS: Keep the structure the same Change the information to your own story What does the time import do? What does the triple “”” do? Why is this useful? Why does work the way it does?

16 Making your own Functions
TASK 5 Add this code to your Adventure Game:

17 Algorithms as Flowcharts

18 Flowchart of Adventure
TASK 6: Create a flow chart planning out the structure and decisions in your adventure T7 Extend your Code TASK 7: Where will your Adventure go? Use the skills learned to extend your Adventure T8 Evaluate your Program TASK 8: Print screen your code, print screen it running & evaluate the program. For maximum marks use technical terms, discuss the problems you encountered, solutions as well as the what went well & how you could improve it .

19 1. Random function 2. Lists / Arrays 3. Functions Extension work


Download ppt "Story time Task 5 Computer Programming Gray , Calibri 24"

Similar presentations


Ads by Google