CSE 143, Homework 5

Something to Celebrate


introduction | objectives | overview | specifications | written work
resources | hints and tips | submission | grading | files | announcements

introduction

Fireworks are a favorite part of summer for many people.  Independence Day celebrations, midsummer's festivals, baseball games, family reunions...pick your favorite.  The biggest cause for celebration is coming up soon: your own graduation from CSE 143.  For such an event, no ready-made fireworks will do, so make your own!  Explode them in the safety and convenience of the computer.  You and your partner should use everything you can think of to put on the best display you can: data structures, algorithms, classes and inheritance---demonstrate your design, implementation, debugging, and teamwork skills.

objectives

The following concepts and technical knowledge are the focus of this homework:

overview

You will complete a partially implemented project, as before.  However, this time you and your partner will have considerable freedom about how the final result will appear, subject to some constraints about how the implementation is done.  The sample executable that we give you is only a quick draft to hint at what is possible.  Simply imitating the behavior of that program will not earn you full credit for the assignment.  Use your creativity to design something that even a casual observer would judge as interesting.

As in previous homeworks, understanding the provided code and what it implies about the sections of code you must fill in will be crucial to correct, timely completion of the project.  You should begin by studying and discussing the given code carefully, and Part I should help you accomplish this task.

specifications

Under files below, you are given most of the files needed to build a program that works just like the sample executable, but two key classes, FireworksDisplay and FireworksScript, are not fully implemented. This homework has three parts. The first is written only, and the remaining two require both coding and writing.

Part I (individual)

This part must be completed individually, not turned in a as a team. You should submit the following written items, each of which is described in detail below under written work:

As has been the case with project reports, you may handwrite the above items only if your writing is 100% legible. Be aware that your TA is not obligated to grade anything which is unreadable.

There is no web turn-in for Part I.

Part II

In addition to a project report specified below under written work, your programming tasks for this part are as follows:

your subclass of BasicFirework

Derive your first new firework class from BasicFirework, and use BasicRayFirework as a model. For example, you could create a subclass BasicCircleFirework whose explosion consists of small, randomly scattered circles (instead of lines, as is the case with BasicRayFirework). Since you can inherit most of the functionality from BasicFirework, this should require very little code.

You might find the geometric and randomized utility functions in util.h,cpp handy. Study these functions and how they are used in abstract base class BasicFirework.

class FireworksScript

Most of your work on this class will go into implementing method getNextFirework. Do not modify code in the header which we provide; only add documentation for new firework types to the comments at the beginning of the file. For Part II, your implementation should be able to read entries for fireworks of type 'r' (BasicRayFirework) and your new firework type, for which you should choose an appropriate char code (for example, 'p' for a class like BasicPixelFirework). As you add more kinds of fireworks in Part III, you will have to modify this class to allow reading entries for them.

class FireworksDisplay

You are given a partial implementation of this class. Again, do not modify the provided header file. Complete this implementation using the comments as a guideline.

When your work for Part II is complete, your program should build in its entirety and work just like the sample executable, except extended to support your new firework type (subclass of BasicFirework).

fireworks script data file fireworks.txt

The provided fireworks script data file (firework.txt) only contains entries for type 'r' (BasicRayFirework) fireworks. Modify this file by adding at least three different entries to demonstrate your new BasicFirework subclass in an extended fireworks show.

Part III

In addition to a project report specified below under written work, your programming tasks for this part are as follows:

additional fireworks classes

You already implemented a simple subclass of BasicFirework for Part II, so now try something more interesting with your two additional classes. Consier designing various timed effects using methods inherited from TimedProjectile, e.g. a rocket that explodes in more than one stage. Other ideas include a rocket that splits off other rockets, though this is more difficult to implement. In designing your fireworks, keep in mind the functions available to you in class G142Display and util.h,cpp. You are permitted to add utility functions to util.h,cpp, if you wish.

additional background scene element classes

Class Moon is an example of a background scene element class. Think of what other background objects might appear in a fireworks display scene (e.g. skyscrapers, trees, sailboats) and implement two of them, using Moon as a model. Although Moon instances move across the screen, you are allowed to make one of your background elements remain stationary (e.g. building), despite their being subclasses of MovingObject. At least one, however, must be a moving element.

modifying main.cpp

Modify main so that instances of your new background scene element classes are added to the scene before the fireworks display starts.

additional requirements

Remember, especially for your Part III submission, your final program should exhibit not only significant programming effort, but creativity, as well. It is not enough to simply fulfill the minimum requirements outlines here and in the provided code.

Your Part II and III versions should both continue to support the 'r' type firework.

To save time, you may use or adapt code from the textbook or lecture slides for the queue and event list classes.  However, if you do, you are required to give credit by citing your sources in the comments in your code.

As usual, we expect you to always be considering invariants, and you should use assertions throughout your code.

Finally, remember that the only code files you are allowed to modify are the following:

written work

Part I

inheritance chart

Base the inheritance chart on a study of all of the code that you are given to start with.  Locate all the classes that are defined.  On a large sheet of paper, draw and label a box for each class.  Draw arrows between classes that are related by inheritance.  Inside each box, list the methods of the class, but you can omit constructors, destructors, and inherited methods.  Label virtual functions as "virtual" and pure virtual functions with "=0".

Make two copies of the inheritance chart before turning it in (one for you and one for your partner).  Keep a copy handy as you work on the program.  If you have questions for the consultants or TAs, have the chart available to refer to as you talk to them.  They may even require that you have the inheritance chart at hand!

Make sure your name, student number, and section are written in a visible location on the page.

essay question

Write one or two paragraphs on the following:  In the sample program, there is a moon that moves across the screen.  By examining the starter code, describe how this is accomplished. 

Questions you might consider in forming your answer include...

You do not have to directly answer all of these questions, but figuring out the answers should help you write the essay.  

Again, make sure your name, student number, and section are written in a visible location on the page.

partner declaration

As with the rest of Part I, each individual student must submit this, regardless of whether he/she plans to work with a partner.  To repeat, each student, individually, must write and submit a partner declaration. 

In the declaration, state your name, section, and TA name, and if you will be working with a partner, that person's name, section, and TA name. If you do not plan to work with a partner, then you must write "plan to work alone."  Once you have made your partner declaration, you will not be allowed to change your mind--- no changing partners, dropping your partner or adding one if you originally declared you would work alone.

Parts II and III

project report

In addition to your turn-in receipt print-out, you are required to submit the following on paper with each of the two parts' submissions. You should work on each report with your project partner and submit one report as a team.

  1. It may be that your project does not meet the specifications given above. Write a short statement that either says you are in full compliance with the requirements, or lists the ways in which you are not (things that don't work, etc.).

  2. You may decide that the program you turn in is not ideal in some respects. If your boss or fellow programmers were looking at it, what do you think they would find to like or dislike? Write a short paragraph evaluating the project. You could focus on the way it's designed and programmed, or focus on what usefulness the program has. You are required to do more than just make observations about the code or program design. You must explain why some aspect of the program is good/bad or interesting.

  3. Write a statement of acknowledgements. If you took code from anywhere (except what the assignment gives you directly), say where you got it from and who the original author is. You must do this even if you modified the code considerably. If you received help on the assignment from anyone other than course staff (TA, instructors, consultants), please list the name of the person and the extent of their help.

Your answers may be handwritten if they are 100% legible. If your TA can't read it easily, he/she may require you to resubmit it word-processed. Your answers must be on a separate sheet of paper, and not embedded in comments in the program. Please write your name, student number, and section on the page.

resources

hints and tips

submission

As always, be sure to read the official homework submission policy, linked on the course web on the Homework page. For each of the last two parts, you will have to submit your work (1) via the web using the page linked below and (2) on paper.

Your web turn-in for Part II should consist of the files listed below. The form will not accept any other files.

Your web turn-in for Part III should consist of the files listed below. The form will not accept any other files.

*Modifying these files is optional. If you don't need to define any additional utility functions, just submit in the provided versions of these files.

**If you wish, you may modify your first firework type (from Part II) before submitting it for Part III.

Your paper submission for each of Parts II and III should consist of the following:

Especially for these larger homeworks with many code files, as stated on the official homework submission policy page, all parts and pages of your paper submission must be stapled together and sealed in a large envelope. (Don't expect the TA to have a stapler in section, either!) You can lose points for not following these instructions (crazy, but true!) For this homework, you will submit your paper submissions in quiz section or lecture on the due dates at the top of this page.

grading

Grading will be done face-to-face with your TA during the last week of classes.  You will make an appointment to meet the TA for this event.  We'll have more information later about where and when this will be done.  Both partners must be present at the scheduled appointment or the project will not be graded.  Both partners will be expected to understand all of the code and be able to answer questions about it. Grading will be done from the code that you have turned in, as compiled by us in Release configuration.

files


announcements

If any clarifications or changes need to be made for this homework, they will be posted to the cse143-announce e-mail list and linked here.

not clarifications or changes, per se, but other relevant postings:


Return to main Homework page...
Last modified: Sat Nov 17 08:42:40 PST 2001

Save paper. Read documents on the web and, if you must print, print two-sided. Recycle this when you're done.