CSCI 2270 Computer Science 2: Data Structures
Spring 2003
Karl Winklmann
 

Recent news items :

  1. Exemptions from final exam

    Anyone who has earned all 900 possible points so far can afford to get zero points on the final and would still get an A (not an A-) in the course. Such people can therefore afford not to show up for the final.

    Extending this exemption a bit further, we will assume that anyone who has earned 875 or more points so far would easily get 25 points or more on the final and hence get an A for the course. Such people can therefore also afford not to take the final and still get an A.

    Posted: Wednesday, April 30, 2003.

  1. A sample final exam is posted. Also solutions.

    Posted: Friday, April 25, 2003.

 

Assignment 2: “MovingObjects3D”

Handed out: Monday, January 27, 2003

Due: Friday, February 21, 11PM

 


Previous page | Next page | Schedule and syllabus | Home Page | Bulletin Board | Current notes | Assad's Page | Programs | Table of contents | News archive | Dora

Description

Make two additions to Assignment 1: a third dimension and menu choices for taking a picture and displaying it again later.

Details

When you draw the pictures make sure that objects further away appear smaller and are not obscuring objects that are closer. Do this by drawing the objects in order of decreasing distance.

Use dynamically allocated arrays to store the necessary information. Start out with an array of size 8.

Give the user these menu options:

void showMenu ()
{
    cerr                                         << endl <<
    " t: launch new ball                       " << endl <<
    " r: launch a number of random balls       " << endl <<
    " e: read input from a file                " << endl <<
    " n: start new picture                     " << endl <<
    " s: store current picture                 " << endl <<
    " d: display the previously stored picture " << endl <<
    " q: exit                                  " << endl;
}
As always, when the user types an invalid menu choice your program needs to output a list of the valid choices.

Assume that when user wants to read the input from a file, the file contains some number of lines, each containing six integers that specify the initial values of x, y, z, dx, dy, and dz for throwing another ball. Don't do any error checking on that (or any other) input, other that checking if the file exists.

Files

You need to submit six files: main.cxx, MovingObject.h, MovingObject.cxx, Picture.h, Picture.cxx,and a suitable Makefile. The first three are variations of the same files from Assignment 1. The files Picture.h and Picture.cxx contain whatever else it takes to do this assignment.

Getting Java

For this assignment you need to use the drawing program. If you are not working in the lab and do not have Java installed where you do work, you can to download it, e.g., from http://java.1.com/j2se/1.4/download.html.

Grading guidelines

                    Compiles without errors:  10
            Reasonable and consistent style:  10
                Objects move properly in 3D:  10
             Distant objects appear smaller:  10
  Distant objects don't obscure closer ones:  20
         Using dynamically allocated arrays:  20
Ability to remember and redisplay a picture:  20
________________________________________________

                                      Total: 100
 


© Karl Winklmann               7:10 PM, Friday, May 2, 2003