CS110 Introduction to Computer Science

Fall 1998

Programming Project #2

Due in class on Tuesday, September 29, 1998.

This project is designed to give you sufficient exposure to the graphics library and the use of simple C++ functions.

  1. Program 1: Write a C++ procedures named Standing(), and Jumping(), that draw a standing and jumping stick figure, respectively, in the Drawing Window. Use them in a program as follows:

     main() {
    Setup();

    Standing();
    Jumping();
    Standing();
    Jumping();
    WrapUp();

    }
       

    You will not be able to see the animation, as they will be executed very quickly. Later, we will learn how to properly animate them. For the project, you will simply submit two copies of the Drawing window, showing the two figures.
  2. Program 2: Write a C++ program that, given the width, the height, and the length of a rectangular prism in pixels, draws the prism in the Drawing Window.




    Note: Think hard about this one. You have to ensure that the prism has exactly the dimensions given. I will discuss some strategies in class.
  3. Program 3: Flesh out the following function to draw a self-portrait in the given box:
    void DrawFace() {
    FrameRect(25, 25, 125, 125); // Draws a 100 x 100 pixel rectangle
    // Write instructions to draw self-portrait below
    ...
    }

Create a separate project for each exercise.

What to Hand in:

For each Exercise, you will hand in the following:

  1. A problem definition form (see below for the format)
  2. A printout of your C++ program file.
  3. A printout of your project window (select the project window and choose Print from File menu to get this).
  4. Sample runs.

Additionally, write a short paragraph/essay on your experiences in working on this assignment.


Sample Problem Definition Form

Problem: State the problem here.

Inputs: Identify the inputs to the program

Outputs: Specify the output of the program

Algorithm: Show the main steps of the algorithm that solves the problem.


Each C++ program should have the following:

// Program Name: <The name of your C++ program file>
// Programmer: <Your name here>
// Address: <your e-mail and Campus Address here>
// Assignment Number: <put project number here, e.g. Project#1, Part A>
// Purpose: <A short problem description>


Back to CS110 Page