CS 111 - 1/24/17 Quiz 1 Q. 1 - Simple variable assignment, access and operation Q. 2 - Highlighting Sequential Access x = 5 y = x + 2 x = 32 print y # the value of 7 is printed Q. 3 - Order of Operation Precedence z = w + x * y Assignment Statements are NOT the same as Algebraic Statements For Example: x = x + 1 The above is an invalid Algebraic Statement The above is an extremely Assignment Statement In assignment statements, the right-hand-side of the statement is evaluated first then the resulting value is stored in the variable specified on the left-hand-side. We have mentioned function, which are a collection of statements Next: Turtle Drawings Take the programming ideas from Chapter 3 Use the Application Domain Area from Chapter 17 The best help/documentation for the Turtle Drawings is found in the help menu of the JES software Other documentation is found in Chapter 17 and the inside back cover of the text book. These two documents sources refer to "Methods" rather than "Functions" The difference between "Methods and Functions" is largely organizational and syntactical Methods are a key element of Object Oriented programming. Key Concept of Turtle Drawing 1. We have Turtle that live on a World 2. Each Turtle has a pen attached to its back. 3. As the turtle moves around the world (and if the pen is "down"), the turtle leave a line showing how it moved. Our job is the have the Turtles draw something specific The primary operations that we can tell a turtle to do is: - move forward - turn to change directions - lift the pen UP or place the pen DOWN - change colors for the pen (this is METHODS only) Programming Goals with Turtle drawings - better understand sequential execution - understand the idea of iteration (i.e. Looping/repeating) - understand how to write our own functions