CS 372 Spring 2016  >  Assignment 3


CS 372 Spring 2016
Assignment 3

Assignment 3 is due at 5 pm Tuesday, April 5. It is worth 20 points.

Procedures

This assignment is to be done individually.

Turn in answers to the exercise below on the UAF Blackboard Learn site, under Assignment 3 for this class.

Exercises (20 pts total)

Exercise A—Introduction to PostScript

Purpose

In this exercise you will learn the basics of the PostScript programming language, and you will write a PostScript program.

Instructions

Install a PostScript previewer, if you do not already have one.

Work through A First Guide to PostScript, by Peter Weingartner. Focus on the first 5 sections, through “Drawing and Filling Shapes”. You may then skip a couple of sections, to cover the “Transformations” section.

Then do each of the following 7 steps.

  1. Modify the Drawing a Box program, so that one side of the square is left open—that is, without a visible stroke.
  2. Modify the Rotation Example program, so that the line being drawn gets longer as the rotation progresses.
  3. Modify the Translate program, so that it draws a 3-by-3 array of boxes.
  4. Modify the Shade and Width Example program, so that the boxes appear to have roughly the same size.
  5. Modify the above program again, so that the last box is drawn several times at different rotations.
  6. Write a program of your own that draws something moderately complex, including at least one circle or circular arc. To draw a circle or arc, you will need to use the arc command, described in the tutorial here.
  7. Combine these six programs into one program that prints six pages. The first page contains the output from step 1, the second page contains the output from step 2, etc.

On Blackboard, turn in the .ps file for the final (step 7) program above.