TWiki
>
CS111 Web
>
WebLeftBar
>
NotesF16
>
CodeF16
>
AssignmentsF16
>
Lab2f16
(2016-09-12, Main.troy)
(raw view)
E
dit
A
ttach
---++ <a href="http://www.cs.uic.edu/CS111/" target="_top">CS 111 - Introduction to Computing, Fall 2016</a> ---+++ Lab 2 ---+++ Lab Assignment *Due: Wednesday 9/14/2016 by 11:59 pm* For this lab assignment, complete the following: 1 Write a Python program that contains a function called lab2() within a file that is named NETIDlab2.py where NETID is your own UIC NetID. <br /> <p> </p> 1 The code in the function lab2() is to use a *single* turtle to draw out your initials on an image/world. Each letter needs to be drawn in a different color. After the turtle has drawn your initials, show them. <p>This lab assumes your initials have 3 letters. If you don't have three letters for your initials, add a number or some other symbol to get it to at least three "initials".</p> <p>The key to this lab is to write the letters using very "blocky" upper case letters. For example:</p> <blockquote> <img alt="" src="http://www.cs.uic.edu/~i101/labs/lab3.jpg" /> </blockquote> I made letters that were 100 pixels high and 50 pixels wide. I also put a space of 25 pixels between each letter and left a space of 25 pixels around the border. You don't need to follow my plan exactly, but I think it works fairly well. I also set the width of the pen to be a little thicker than the default size of 1 pixel wide. <p>Remember to keep the pen up between letters. This is done by using the penUp() and penDown() functions in JES.</p> <p>Also, remember to change the color of the pen. You specify the color of the pen using the setPenColor() method from the Turtle class. The parameter will be the color you wish to use.</p> <p>For example, set have the turtle "turtle1" draw with the color red you would use the code:</p> <blockquote> *turtle1.setPenColor ( red );* </blockquote> The following colors are predefined in JES: <table border="1" cellpadding="1" cellspacing="1"> <tbody> <tr> <td>black</td> <td>white</td> <td>gray</td> <td>darkGray</td> <td>lightGray</td> </tr> <tr> <td>red</td> <td>green</td> <td>blue</td> <td>yellow</td> <td>cyan</td> </tr> <tr> <td>magenta</td> <td>orange</td> <td>pink</td> <td> </td> <td> </td> </tr> </tbody> </table> <p>Also you can check out the code we did in class that draws lines in different colors. That code is [[CodeF16][lect00908c.py]] .</p> <p> </p> 1 Be sure to include a comment at the top of your python file that contains the following: * your name * your NET-ID * day and time of your CS 101 lab section (i.e. Monday at 2:00) * A description of the project. <p> </p> This information is a part of Good Programming Style. Leaving off this information will cause you to get less than full marks for this lab assignment. *Submission of the Lab* Use the Lab 2 submission link in the Information Page of <a href="https://blackboard.uic.edu/webapps/login/" target="_top">Blackboard</a> for CS 111. You will only need to submit the python source code file. You are to name your file with both your <a href="http://www.cs.uic.edu/bin/edit/CS101/NetID?topicparent=CS101.Lab3s12" rel="nofollow" title="NetID (this topic does not yet exist; you can create it)">NetID</a> and the lab number so we can find it easier. For someone with the <a href="http://www.cs.uic.edu/bin/edit/CS101/NetId?topicparent=CS101.Lab3s12" rel="nofollow" title="NetId (this topic does not yet exist; you can create it)"> NetId </a> of *tsmith14* the file should be named: <pre> tsmith14lab2.py</pre> -- %USERSIG{troy - 2016-09-09}% ---++ Comments <br />%COMMENT%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r5
<
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r5 - 2016-09-12 - 19:02:35 - Main.troy
CS111
Web Page Spr 18
Syllabus Spr 18
Lecture Notes Spr 18
Sample Code Spr 18
Assignments Spr 18
[edit this menu
]
Log In
CS 111 Main Page
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
ABOUT US
Our Department
Recent News
Contact Us
ACADEMICS
Prospective Students
Undergraduate
CS Minor
Graduate
Courses
RESEARCH
Overview
By Faculty
Labs
PEOPLE
Faculty
Adjuncts
Staff
Students
Alumni
Copyright 2016 The Board of Trustees
of the University of Illinois.
webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF