HOMEWORK 11 - CLASS FUN

The Purpose

The purpose of this homework is twofold, to give you more practice on (1) writing your own objects and (2) using objects of classes written by others. You can learn how to work with objects from others by looking at the member functions provided in the class.

The Goal: Part I

The goal of this homework is to create a unique class of a "magic item", which allows the user of the "magic item" to do something and then, perhaps, win something. Your "magic item" can (and should) have different behaviors than the "magic items" created by your fellow students. For example, a "magic item" may ask a riddle and, if answered correctly, awards a potOfGold. In addition to answering a riddle, other example behaviors are solving a math problem, answering a trivia question, playing a slot machine, etc.

The Goal: Part II

You are also required to write a main.cpp that uses your "magic item" and three other "magic items" written this semester by others. Your main.cpp should first welcome the user, and then tell the user what he/she must do to win a prize. Then, allow the user to use the objects (created from the "magic items" chosen) to determine what prizes the user wins.

Examples

To illustrate this "magic item" idea, example 1 and example 2 are provided. You are not allowed to use these "magic items" in your main.cpp (nor copy the example code to create your own "magic item" class either!)

Code Sharing

Before sharing your "magic item" class with another, you should include both your name and CSCI 261 section number in both files associated with your "magic item" class. In other words, your "magic item" class is your work; make sure you take credit for it!

In your main.cpp file, also include all names of people you shared your "magic item" class with.

If you are interested in having others use your awesome "magic item" class, feel free to post an advertisement on Piazza (with your email address so students can contact you for a copy of your code). Do NOT post your "magic item" class on Piazza. Also, please post your advertisement as a NOTE (not a question).

There will be a prize for the author of the "magic item" class that is used the most! Be creative!!

Note: you can NOT post an advertisement for your "magic item" before Thursday, April 7th, at 5pm MT.

A Few Requirements

To receive full credit, the following requirements must be met:

Homework Grade and Submission

Your Homework 11 grade will be based on your solution to this assignment and your solution to Lab11A, Lab11B, and Lab11C. In submitting your homework assignment (due Apr 13th), follow these steps: