Welcome to the temporary page for the official Nightmare Productions C++ Contest. What do we hope to achieve by holding such a contest? We are attempting to spread the knowledge of C++ and hopefully get others interested in it. The contest description is below. In order to enter the contest, you must attach all of the files (.cpp, .h, and .doc files) to your reply in this topic. The deadline for entries is December 7, 2008. The winners will be announced by the 30th and will recieve their prizes. What are the prizes you ask? Well, thanks to all of the people who donate and to Machinima.com for hiring us, we are able to make the prize HUGE...kinda. This prize is a once in a life-time thing for us. There won't ever be another time where we will offer a prize this big. There will be 2 winners. The winners will be able to choose from three prizes:
(1)- $200 in cash. The winner can recieve this via check or PayPal.
(2)- $200 in Microsoft Points. The code will be sent via email unless the winner requests the point cards to be sent via mail.
(3)- $200 in Wii Points. See the previous prize's details for specifics.
The winners will be based on the speed that the code was recieved and the quality of the code. One winner will be chosen for being the fastest and best code while the second will be chosen for having the best quality code out of all of the entries. The winners will also have their code advertised on our Contests page (still in progress). We hope you all have fun with this. This is an easy way to get some quick spending money for the holiday. Good luck!
CONTEST DESCRIPTION
The files used for this contest are attached.
Please note that there is a small error in the code in order to provide more of a challenge. If you can't figure out how to fix it, feel free to send in the code with errors (I will only accept a small amount of errors). Please put your name, username, and email(optional) in the comment box at the top of your code.
BTW, I made it Simpsons themed to entertain you all more :D.
Here is what you need to do:
For this contest, a lot of my code will remain in tact. Your code for the bar classes will be the same and that for the drunk will change ever so slightly. Coooool. You will have to add some functions to the town class and some content to the TeaTotaller and police classes.
The objective of this program is to determine how much property damage that the drunks in the town will do while they are wandering about the streets interacting with the tea-totallers and the police. The interactions will begin after the drunks are booted out of the bar (bar closing) and will end when there are no longer any drunks on the streets. This will require you to write a function to add to thetown class that triggers the interactions. Let's call this function Operation_Street_Sweeper(), and it will be called by the town object after the to_the_streets function is called.
Let's layout the characters involved:
The drunks:
The drunks now need a member function that is called to "implement" the passing of time and its effect on the drunk. Call it sober() and it will reduce the bac of the object by 0.01. Thus, each time it is called, the drunk sobers a little bit (time passes, you sober up).
The police:
data:
a name
an int to keep track of then number of drunks they have encounter (during the simulation only).
the doughnut factor, a float.
functions:
appropriate constructors
overloaded extraction operator
insertion operator
a function to increment their drunk-encounter count
a bool function that determines whether or not the officer goes for a doughnut. This function will determine that probability by multiplying the doughnut factor by the number of drunk encounters. Using the random number generator with this probability then determines whether the officer leaves the scene.
The TT class:
data:
name
a float to represent their "annoyance factor".
functions:
appropriate constructors
extraction and insertion operators
a boolean function that will take a float. This parameter represents the bac of the drunk that the TT will encounter. If this bac is greater than the TT's annoyance factor, then the function returns false. Otherwise, it will reduce the annoyance factor by the bac of that drunk and return true. Call this function the tollerance funtion..
The town class:
new data:
property damage, a float. Be sure to include in your constructors!
new functions:
Operation_Street_Sweeper(). This function will:
while (there are drunks in the streets)
{
for each drunk from the array
choose a person from one of the 3 arrays (police, drunk or TT)
if two drunks meet
tally property damage.
else if drunk meets officer
increase officer's drunk encounters.
determine if officer goes for doughnut.
if so
remove officer from array.
else
remove the drunk from the array.
else if drunk meets TT
pass the drunk's bac to the TT's tollerance function
if it returns false
remove the TT from the array
have each drunk call its sober() function.
if bac==0
remove from array.
}
Now, we are leaving it up to you to determine how and by how much the property damage is caused. Think about this and make it logical....and interesting....and funny! Document PROMINENTLY your implementation for the grader.
The main function will be the same as the previous assignment's, but will have the town call its Operation_Street_Sweeper function.
Output: After the to_the_streets function is called, output the contents of the three arrays (labelled and easy to read. Also, as any person (police, TT, or drunk) is removed from their respective arrays (signifying they are no longer on the scene), output a simple message stating who left, their pertinent stats (e.g. a drunk leaves, include his/her bac) and why. Finally, output the property damage in the town due to the drunks. You must decide when and how to implement these output functions. Make them wise decisions.
Optionals: You may include some funny stuff when you satisfy all the above requirements. For example, you could have each charact utter some funny comment randomly chosen from a file of (appropriate) comments every time they are removed from the street. If you add stuff, put a big comment block at the beginning of the main function explaining to your grader what you have done extra.
The Others:
Police: (name and doughnut factor) NOTE: In no way is this assignment meant to denegrate the police in reality.
Wiggum, Chief 0.05
The_cop, Lou 0.06
The_cop, Eddie 0.08
Teatotalers:
Guy, Comicbook 4.5
Chalmers, Superintendant 4.0
Man, Bumblebee 3.7
Stu, Disco 4.1
Flanders, Maude 6.7
Frink, John 2.3
Hutz, Lionel 4.1
Lovejoy, Helen 6.1
Malibu, Stacy 4.8
Smithers, Waylon 7.1