70 likes | 173 Views
Computer Programming. Important concepts. Looping (repeat statement) Named procedures Parameter passing Now we will use these ideas in a more complex problem. Looping, procedures, parameter passing. Consider what procedures you might find useful by trying to identify the repeating patterns
E N D
Important concepts • Looping (repeat statement) • Named procedures • Parameter passing • Now we will use these ideas in a more complex problem
Looping, procedures,parameter passing • Consider what procedures you might find useful by trying to identify the repeating patterns • How can you use parameter passing to vary the size of the chess board?
Google Sites • Create site • Blank template • URL = username_cp • Make Logo page • Create three subpages: • looping • parameter passing • procedures • An image • Some code • Some explanatory text
More complex patterns Useful commands: • setpencolor [rrr ggg bbb] • setfloodcolor [rrr ggg bbb] • fill
Quick quiz coming up Next TuesdayAdd to yourcalendar • REPEAT statement • Creating subprocedures • Passing parameters • Knowledge and Understanding • Reading and interpreting code • Application • Writing code • Communication • Defining terms, explaining approach and concepts, etc
Examples • The following Logo commands create the shape shown but some of the commands are missing. Write down the missing commands. [5 marks] • fd 100 • rt 90 • fd 50 • … • fd 100 • lt 90 • fd 150 Define the term procedure. [1 mark] Give two advantages of using procedures in computer programming. [2 marks] Write code to draw the following pattern in Logo. You will gain points for correct code and for using a sensible approach.[6 marks] Write a logo procedure triangle to make an equilateral triangle. The side length of the triangle should be passed to the procedure as a parameter. [3 marks]