Show Bid Request
Guessing Game #0
Bid Request Id: 38171
|
|
|
Posted by: |
aminew (21 ratings)
(Software buyer rating 10)
|
Non-action Ratio: |
Very Good - 0.00%
|
Buyer Security Verifications: |
Good
|
Approved on: |
Dec 3, 2002 5:15:22 PM EDT
|
Bidding Closes: |
Dec 5, 2002 5:18:00 PM EDT
|
Viewed (by coders): |
137 times
|
Deadline: |
12/8/2002 5:18:00 PM
TIME EXPIRED
|
|
|
|
Description:
Write a program that allows the user to play guessing games.
A guessing game is where the computer generates a random number and the user tries to guess it. The program loops until the user guesses the random number, or enters a sentinel value to give up. After five wrong guesses, the user is given help (higher or lower messages).
After a game has been completed, the program asks the user if they want to play again. The user is allowed to play at most 256 games.
Prior to terminating program, print the following.
number of games played number of games won winning percentage
At the end of your program should be a comment block that contains the pseudo-code for your program.
This program must be split into at least three functions.
Required Manifest Constants Your program must define the following manifest constants prior to the definition of the main() function (i.e. make these global): const int MIN_NUMBER = 1; const int MAX_NUMBER = 100; const int EXIT_VALUE = -1; const int MAX_GAMES = 256; Generating a Random Number Include the time.h header file. To generate a random number that ranges between MIN_NUMBER and MAX_NUMBER (inclusive), use code similar to the following: srand(time(NULL)); randomNumber = MIN_NUMBER + rand() % (MAX_NUMBER - MIN_NUMBER + 1); The time() function returns the current date and time in seconds since 01-Jan-1970 00:00:00 GMT. Passing this return value to srand() "seeds" the random number generator so that a different set of random numbers are generated every time the program is executed. The rand() function returns a random number between 0 and RAND_MAX (a manifest constant defined in stdlib.h).
Deliverables: 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Example Game:
Assume the computer generated random number is 34 for game #1, 73 for game #2, and 99 for game #3. For example purposes, user inputs are enclosed in brackets <>.
*** You are playing the CIS162 Guessing Game ***
Enter a number between 1 and 100 (-1 to give up): <3>
nope...
Enter a number between 1 and 100 (-1 to give up): <1001>
1001 is too big...
Enter a number between 1 and 100 (-1 to give up): <0>
0 is too small...
Enter a number between 1 and 100 (-1 to give up): <33>
nope...
Enter a number between 1 and 100 (-1 to give up): <50>
nope...
Enter a number between 1 and 100 (-1 to give up): <21>
nope...
Enter a number between 1 and 100 (-1 to give up): <41>
nope...
Enter a number between 1 and 100 (-1 to give up): <27>
nope...higher
Enter a number between 1 and 100 (-1 to give up): <57>
nope...lower
Enter a number between 1 and 100 (-1 to give up): <34>
*** GOT IT *** it took you 8 guesses
Do you want to play again? (y/n): <y>
Enter a number between 1 and 100 (-1 to give up): <99>
nope...
Enter a number between 1 and 100 (-1 to give up): <-1>
*** QUITTER ***
Do you want to play again? (y/n): <y>
Enter a number between 1 and 100 (-1 to give up): <21>
nope...
Enter a number between 1 and 100 (-1 to give up): <99>
*** GOT IT *** it took you 2 guesses
Do you want to play again? (y/n): <n>
Thanks for playing the CIS162 guessing game.
You played 3 games and won 2 of them.
Your winning percentage is 66.7%.
Platform:
Windows XP
Must be 100% finished and received by buyer on:
Dec 8, 2002 5:18:00 PM EDT
Deadline legal notes: All times are expressed in the time zone of the site EDT (UT - 5). If the buyer omitted a time, then the deadline is 11:59:59 PM EDT on the indicated date.
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$15 (USD)
|
Dec 3, 2002 5:39:27 PM EDT
|
9.62
(Excellent)
|
|
|
Hello, I can provide you the code for the project in less than 1 day. Also,I assure you that it will be well commented and very comprehensible. Hope I'll hear soon from you. Sincerely, mstrocan
|
|
|
|
|
|