Course Home | Class Schedule | Moodle CMS | Git Submission | Perusall | Tutoring

Saint Louis University

Computer Science 1300
Introduction to Object-Oriented Programming

Michael Goldwasser

Spring 2020

Computer Science Department

Homework Assignment 05

Please make sure you adhere to the policies on academic integrity.


Problems to be Submitted (20 points)

This homework is a bit more challenging than the past homeworks, but it seems like it would be good to have you practice these techniques with more time available, prior to our hands-on day.

  1. (10 points)

    On a recent quiz (solutions here), you were asked to create the following image

    however you were allowed to hardcode the geometry for this 500 x 300 canvas.

    For this problem, we wish to have you recreate such a script, but with the entire drawing created proportionally based upon a variable w that represents the width of the screen. You need not concern yourself with the canvas title or background. We are only interested in the geometry.

    When w=500 your script should produce the same picture as above, but if for example w=1000, the following should result.

  2. (10 points)

    Write a new script for the 500 x 300 version of the above script (you are welcome to hardcode the geometry this time). In this new script, you are to create a layer that contains both the body and head of the animal, placed so that the center of the body rectangle is at the origin of the layer.

    Then place the layer on the canvas and move it to the position matching the original image, and then rotate it by -30 degrees. The result should appear as follows


Michael Goldwasser
CSCI 1300, Spring 2020
Last modified: Sunday, 22 December 2019
Course Home | Class Schedule | Moodle CMS | Git Submission | Perusall | Tutoring