COSC 1P02 Lecture Notes - Lecture 2: Turtle Graphics, Cosc, Virtual Machine

151 views3 pages

Document Summary

Originally for consumer electronics (i. e. microwave ovens, refrigerator, televisions, etc. ) T u r t l e has a position and direction and travels a distance. T u r t l e represents a turtle: can move with pen down (draw, can change direction. Loops are a way to repeat statements of code within a program. Ex) for (int i = 0; l < 4; l ++) Creating an integer named l and initializing it with the value of 0. Then stating its limit; the for loop will end once the variable l hits the value 4. However, the loop will end before the value is 4 because it is not inclusive. The increment is 1 due to the double plus sign. While loop will run indefinitely until the condition is not true. Creation of a boolean value (true or false) and it will run until the variable is declared as false. Inner loop done completely each time through outer loop.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers