CS 111 - Introduction to Computing, Spring 2017

Lab 2

Lab Assignment

Due: Wednesday 2/1/2017 by 11:59 pm

For this lab assignment, complete the following:

  1. Write a Python program that contains a function called main() within a file that is named NETIDlab2.py where NETID is your own UIC NetID.

  2. The code in the function main() 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.

    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".

    The key to this lab is to write the letters using very "blocky" upper case letters. For example:

    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.

    Remember to keep the pen up between letters. This is done by using the penUp() and penDown() functions in JES.

    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.

    For example, set have the turtle "turtle1" draw with the color red you would use the code:

    turtle1.setPenColor ( red );
    The following colors are predefined in JES:
    black white gray darkGray lightGray
    red green blue yellow cyan
    magenta orange pink

    Also you can check out the code we did in class that draws lines in different colors. That code is lect0126c.py .

  3. 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.

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 Blackboard for CS 111. You will only need to submit the python source code file. You are to name your file with both your NetID and the lab number so we can find it easier. For someone with NetId of tsmith14 the file should be named:

Topic revision: r2 - 2017-01-30 - 15:48:16 - Main.troy
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
Helping Women Faculty Advance
Funded by NSF