CSI Lecture Modifying Pictures Using Loops

CSI Lecture Modifying Pictures Using Loops - CSI 201...

Info iconThis preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSI 201 Introduction to Computer Science Spring 2010 1 LECTURE 7 Wednesday, February 10, 2010 2 ICLICKER QUESTION 3 ICLICKER QUESTION A. B. C. D. E. None of the above. Which one of the following colors is a blend? SECONDS REMAINING ICLICKER QUESTION A. B. C. D. E. None of the above. Which one of the following colors is a blend? SECONDS REMAINING 4 ANNOUNCEMENTS 5 SUMMARY In this assignment you will add a method to the Turtle class to draw a star DEADLINE This assignment is due on Thursday, February 18 at 11:59 pm. PRE-REQ For this assignment you will need to have added the book classes to your DrJava classpath. Refer to the lecture slides, lab 3, and Blackboard to complete this. DESCRIPTION METHOD Create a new method drawStar(int length) at the bottom of Turtle.java. (Just before the main method) This method will have the following behavior: The turtle will draw a star in its world. The length of each line in the star will be determined by the length parameter. The star will be oriented upright to the heading of the turtle. That is, if the turtle begins heading north the star should be upright. (See example below) If the turtle begins heading south the star will be upside down, and so on. Finally, once completed the turtle should return to its original location and heading. To draw a star, think about the angles. (You have to remember a little trig here.) What is the interior angle of each point? How much does the turtle need to turn to draw the next line? Once you have created your method compile Turtle.java and test it out in the interactions pane. Remember you have to create a new world and new turtle each time you compile. Example 1 : World earth = new World (); Turtle t1 = new Turtle (earth); t1.drawStar( 200 ); turtle1.drawY(); turtle1.drawZ(); turtle1.hide(); Introduction to Computer Science CSI201 Spring 2010 ASSIGNMENT 1 ASSIGNMENT 1 Assignment 1 is now posted on Blackboard It is due Thursday, February 18 at 11:59 pm. Review the Assignment Guidelines on Blackboard for information regarding grading policy. 6 NO COMPILER AVAILABLE If you see this message you need to install the JDK Instructions and the link to download the JDK are in the discussions section of Blackboard 7 OFFICE HOURS TAs hold their ofce hours in the lab room (HU25) This is where you can go to get help with course material (examples, labs, assignments) Other courses hold ofce hours in this room Please do not ask TAs for other classes for help (They have their own work to do) We have plenty of our own TAs 8 MISSED LECTURES/LABS If you miss a lecture: Check the lecture slides on Blackboard Check for new assignments if it is time You cannot make up iClicker points Thats what the 15% is for, so you can miss a few classes You dont need to tell me about it If you miss a lab: You cannot attend another lab section You can see any TA during their ofFce hours to make up your lab You have two weeks You also do not need to tell me about this 9 TODAYS CONTENT 10 MODIFYING PICTURES USING LOOPS 11 This material corresponds to chapter four in the text....
View Full Document

This note was uploaded on 02/07/2011 for the course CSI 201 taught by Professor Doanne during the Spring '08 term at SUNY Albany.

Page1 / 75

CSI Lecture Modifying Pictures Using Loops - CSI 201...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online