943,904 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1221
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 22nd, 2008
0

Easy C++ Contest!

Expand Post »
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 .

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:
C++ Syntax (Toggle Plain Text)
  1. while (there are drunks in the streets)
  2. {
  3. for each drunk from the array
  4. choose a person from one of the 3 arrays (police, drunk or TT)
  5. if two drunks meet
  6. tally property damage.
  7. else if drunk meets officer
  8. increase officer's drunk encounters.
  9. determine if officer goes for doughnut.
  10. if so
  11. remove officer from array.
  12. else
  13. remove the drunk from the array.
  14. else if drunk meets TT
  15. pass the drunk's bac to the TT's tollerance function
  16. if it returns false
  17. remove the TT from the array
  18. have each drunk call its sober() function.
  19. if bac==0
  20. remove from array.
  21. }
  22.  
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.
C++ Syntax (Toggle Plain Text)
  1. Wiggum, Chief 0.05
  2. The_cop, Lou 0.06
  3. The_cop, Eddie 0.08
  4. Teatotalers:
  5. Guy, Comicbook 4.5
  6. Chalmers, Superintendant 4.0
  7. Man, Bumblebee 3.7
  8. Stu, Disco 4.1
  9. Flanders, Maude 6.7
  10. Frink, John 2.3
  11. Hutz, Lionel 4.1
  12. Lovejoy, Helen 6.1
  13. Malibu, Stacy 4.8
  14. Smithers, Waylon 7.1
Attached Files
File Type: zip Contest_Files.zip (9.4 KB, 13 views)
Last edited by Narue; Nov 23rd, 2008 at 11:51 am. Reason: sanitized (slightly) and fixed formatting
Similar Threads
Reputation Points: 11
Solved Threads: 0
Newbie Poster
drkessence is offline Offline
7 posts
since Nov 2008
Nov 23rd, 2008
0

Re: Easy C++ Contest!

Thanks for putting this back up!!
Reputation Points: 11
Solved Threads: 0
Newbie Poster
drkessence is offline Offline
7 posts
since Nov 2008
Nov 24th, 2008
0

Re: Easy C++ Contest!

You should make the rules less restricitve andjust include the objective: "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"
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
CPPRULZ is offline Offline
91 posts
since Aug 2008
Nov 24th, 2008
0

Re: Easy C++ Contest!

ummm....lol. What a rediculous objective. Is this to be console based? No graphics whatsoever? If it is console based, I'd say that the contest is much too easy and find it hard to believe that an award is really being offered.
Reputation Points: 352
Solved Threads: 109
Master Poster
skatamatic is offline Offline
779 posts
since Nov 2007
Nov 24th, 2008
1

Re: Easy C++ Contest!

Click to Expand / Collapse  Quote originally posted by skatamatic ...
ummm....lol. What a rediculous objective. Is this to be console based? No graphics whatsoever? If it is console based, I'd say that the contest is much too easy and find it hard to believe that an award is really being offered.

Then why don't you cry about it? Oh wait, you did.

(Graphics??? WTF are you thinking?)
Team Colleague
Reputation Points: 1135
Solved Threads: 171
Super Senior Demiposter
Rashakil Fol is offline Offline
2,478 posts
since Jun 2005
Nov 26th, 2008
1

Re: Easy C++ Contest!

The reason for the restrictions as CPPRULZ was asking about, is in order to provide more of a challenge. As skatamatic said, this is a very easy contest. And in reply to the rest of his post, this contest was MEANT to be easy. This isn't for personal gain or to promote myself. This is to promote C++ programming. I have a degree in Computer Science and love programming. However, it disappoints me to see how few people know about C++. In order to try to get the word out, I'm hosting this contest and then displaying the results on my website as well as on a future video that I make for Machinima.com. If you don't like the minimal challenge it provides then feel free to pass it up. However, if you think it's so easy then you shouldn't have any problem in completing this and possibly winning $200. I've done these contests before(although the prizes were considerable smaller) and they've all gone over well. Also, like Rashakil Fol said, Graphics??? WTF are you thinking? lol I personally hope that someone from daniweb wins because I constantly use these forums to get help with personal projects that I do.
Reputation Points: 11
Solved Threads: 0
Newbie Poster
drkessence is offline Offline
7 posts
since Nov 2008
Nov 26th, 2008
0

Re: Easy C++ Contest!

Lol. well if it really is a genuine contest then I suppose I should probably make an entry. When's the deadline? And by graphics, I meant having a display of a bunch of drunks walking around with police, and having damage being done to property What else would i be thinking?
Reputation Points: 352
Solved Threads: 109
Master Poster
skatamatic is offline Offline
779 posts
since Nov 2007
Nov 27th, 2008
0

Re: Easy C++ Contest!

Well, the official deadline is November 7th. I was thinking about pushing it back a little bit since I'm going out of town for a couple days. I'm going to be interviewing Rich Taylor(Senior Vice President of Communications for the Entertainment Software Association and creator of E3). I think I'll just keep the date though as I'd like to be able to go over it while I'm sitting in the hotel. If you do submit an entry, which is sincerely hope you do, please don't put graphics or anything special. It'll make it harder to go over and judge along side the other entries. Just keep it basic. As long as the code is good, you should stand a good chance. Good luck!
Reputation Points: 11
Solved Threads: 0
Newbie Poster
drkessence is offline Offline
7 posts
since Nov 2008
Nov 30th, 2008
0

Re: Easy C++ Contest!

Time is almost up!! If your gonna enter any code then you should do it soon. BTW, seeing as how this contest is doing decently well there is a chance I'll be holding another quick contest (with a significantly smaller prize of course).
Reputation Points: 11
Solved Threads: 0
Newbie Poster
drkessence is offline Offline
7 posts
since Nov 2008
Dec 1st, 2008
0

Re: Easy C++ Contest!

lmao, my bad. Forgot the date XP. Keep working, then!! You all still got a week!
Reputation Points: 11
Solved Threads: 0
Newbie Poster
drkessence is offline Offline
7 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Program on strings - Can anyone solve this program?
Next Thread in C++ Forum Timeline: Finding Positon of characters





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC