CIS 3280 - Object-Oriented Programming in C++

Contact Info

Professor: Dr. Melody Moore
Office : RCB building 923
Lab: Park Place 10 suite LLB
Office hours: by appointment
phone: 404-651-0878
lab phone: 404-463-7121
email: melody@gsu.edu

Send Melody mail

Spring Semester 2003

bulletCourse Syllabus

Announcements

Last update:  Apr 21, 2003

bulletLecture notes for Chapter 16 (CGI programming) are posted below.
bulletAssignment 7 is due Thurs Apr 24 at the beginning of class.  Remember that assignments cannot be accepted after lecture starts.
bulletTeaching Assistant:  Mike Smith,  mikesmith@biltmorecomm.com.   Lab phone 404-463-7121, call or email for appointments.

 

Class Schedule

bulletTuesday Thursday 1:00 - 2:15 class

 

Assignments

Homework and programming assignments will be given throughout the semester. Assignments are due at the beginning of class on the day they are due.  Any assignment handed in after lecture has begun will be considered late.  All components of your assignment should be labeled with:

bulletYour Name
bulletCIS 3280 (Semester) (Year)
bulletAssignment Number and name
bulletDate

Homework Assignments

Homework assignments will consist of short answer or program segments.  You may type or hand-write homework assignments as long as they are clearly legible.

Programming Assignments

Please submit a hardcopy printout of your code, with output, and your project source code and executable code (NOT DEBUG VERSIONS). Make sure the code compiles and runs using the Microsoft Visual C++ compiler that is included with the textbook.  Do NOT email your code, emailed programs will not be graded.  We will test your programs by running them.

Debug versions - make sure you copy the .exe from the same directory as your source file (not from the debug folder).  To turn off debugging, go to the Build Menu and choose Configurations.  Then choose "Win32 Release" instead of "Win32 Debug".  This will create an executable that does not have debugging hooks; it will be much smaller.

Assignment Details

Assignment Number Assignment Due Date
1 Adventure Game design Thurs 1-23-03
2 Adventure game Classes - implement class definitions for the following game components (or equivalents in your game):
bulletRooms
bulletMonsters
bulletTreasures
bulletPlayer

Remember that rooms have to be able to be linked together (north, south, east, and west).  Monsters and treasures need to be able to be placed in linked lists.  The Player class can contain information about the game, such as health points, contents of the player's "bag" (things the player is carrying), etc. 

You do not have to implement the initialization routines that builds these linked structures yet, just write the class definitions.   A main routine that instantiates some of these objects is good practice for the quiz but is not yet required.

As always, turn in a hard copy of your code and the electronic version so we can compile it.

Tues 2-4-03

3 Savings Account class - problem 7.8 in the Deitel book.  Implement the savings account exactly as specified in the book, with the following exceptions:
bulletIn your driver program, instantiate the two savings account objects using dynamic allocation. 
bulletInclude a date object in your savings account class, to represent a creation date for the account.  Use the code provided in your book (the code is on the CD that came with the book).  Your constructor for a new savings account should include initialization values for the creation date.
Thurs 2-20-03
4 Adventure Game - Operators and Inheritance
  1. Create overloaded operators for your monster class that will allow them to be added to or removed from a room.  Overload the "+=" operator for adding a monster to a room and the "-=" operator to remove a monster from a room. Then overload the "<<" and ">>" operators to print and read monsters.   For example:

    room  Dungeon;

   monster  Godzilla;  

  

   Dungeon += Godzilla;  // adds Godzilla

                         // to Dungeon

   Dungeon -= Godzilla;  // removes Godzilla

                         // from Dungeon

   Dungeon.Print_Monsters();

   

   In your main routine, instantiate at least four of your

      rooms, and then read in a monster description from the

      user. Show that you can move a monster from room

      to room (adding to one room and deleting from another).

      Show that you can have more than one monster in a

      room.  This will require a function, Print_Monsters, that

      traverses the list of monsters and prints them all.

2. Create an inheritance hierarchy for your treasures.  For example, treasure is the base class and subclasses could be gemstones, coins, or food.  Make sure that each subclass adds unique attributes to the base class.   Instantiate each of your treasures (but don't worry about putting them in a list yet).

Tues Mar 11

5 Map Initialization and Player's Bag

1. Write the initialization routines for your map (link the rooms together to build the map structure).  Place your monsters, treasures, and utility items in the appropriate rooms.

2. Implement the player's "bag" that holds the items the player collects.  Write appropriate functions to put an item in a bag (and thereby remove it from a room) and to drop an item out of the bag (thereby adding it to a room).  Create a base class "Item" that can be subclassed for any item that could be in the player's bag:  treasures, weapons (such as knife or spear), and utility items (such as lamp or healing powders).  Write a polymorphic print function that allows the contents of the player's bag to be printed out appropriately. 

3. Write a main routine (driver) that shows that your polymorphic print of the player's bag works.

Thurs, Mar 27
6

Command Interpreter and Player Status

1. Write a command interpreter to allow the user to input commands.  Use exception handling to handle incorrect user input.  Your command set should contain at least the following commands:

bulletnorth, south, east, west - move in that direction
bulletlook - get a description of the current room, and any treasures, items, or monsters that are held in it
bullettake - pick up an item and put it in the player's bag
bulletdrop - take an item out of the player's bag and leave it in the room
bulletuse - apply an object in a current situation, such as "use key" in the presence of a door
bulletinventory - list the contents of the player's bag
bulletother commands as appropriate for your game - fight, run, etc.

2. Write functions "save_status" and "get_status" that save and restore information about the current Player's status.  Use file I/O to save this information in a record in a file.  When the game is initialized, it should check for a player status file and restore the saved game if one is present.  Player status could consist of points in the game, treasures collected, monsters killed, etc.

3. Write a driver program that demonstrates each of your commands and your status save and restore.

Tue, Apr 8
7 Impress Us

Your game is now almost complete.  To finish it, add one more feature of your choosing that will show off your object oriented design and implementation skills.  Some ideas:

bulletRead the map structure from a file and dynamically allocate the rooms and contents
bulletUse (appropriately) a data structure such as a queue, stack, or tree to store items
bulletAdd commands to the command interpreter that implement more game features
Thurs, Apr 24