- 10 points
- Assigned 2012 Aug 29, due 2012 Sep 12
- If you have a good reason for needing more time, ask the instructor before it is due!
Use the turtle to draw flower-like shapes composed of many squares.
This lab is for the assessment of two competencies:
Programming Exercise 1.1 on page 44. In Oncourse Assignments, turn in your Python source file and three screenshots showing the result of drawflower with three different arguments (number of petals).
- Each "petal" is a square. Use the
drawSquare function presented in the chapter.
numSquares means the number of petals.
- To draw a flower with
numSquares petals, the turtle must turn a total of 360 degrees in
numSquares turns. A simple division will tell you the angle for each turn.
- To make a screenshot in Linux/GNOME: see the chapter X11 and Gnome of the Linux Lab Manual. But note that if you're using VNC, the PrintScreen button might be interpreted by your local computer instead of being sent to merlin.
- If you want to take a screenshot in some other operating system and don't know how, take-a-screenshot.org provides instructions.
- Submit in Oncourse Assignments.
- Submit four files as attachments:
- Your Python source file must have the extension
- Your screenshots must have an approved file format and extension. PNG (extension
.png) and JPEG (extension
.jpg) image files are automatically approved; PNG is preferred. Before submitting any other image file format, ask the instructor. TIFF files are too large; please convert them to PNG before submitting.
Note: If your files (Python and image files) are on merlin, you can either:
- Run a web browser (Firefox and Opera are available) on merlin to connect to Oncourse and submit assignment with attached files; or
- Use an SFTP client (PuTTY's
psftp is one) to download your files to your PC or Mac, and then run the web browser on your PC or Mac to submit your assignment with attached files.
(CA = Competency Assessment)
- 3 CA points (all or nothing) for 01-4 (FUN) Functions. In order to pass this competency, the program must properly call and define the function
drawflower, and must properly call the function
drawSquare (which is defined in the textbook, but you must copy the definition into your program).
- 3 CA points (all or nothing) for 01-5 (LOOP) Loops. In order to pass this competency, the program must draw squares in a loop which repeats the number of times requested in the
numSquares parameter of the
- 4 points (partial credit is possible) if the program actually draws "flowers" with the requested number of petals (squares) and appropriate rotation. You must turn in the screen shots as specified for full credit.
If you do not pass both competencies, you will be able to resubmit your assignment. However, please make a real effort to submit a correct program the first time!