# Guessing Game

This assignment requires the use of random numbers. You must include the <cstdlib> and <ctime> header files to allow access to rand() and srand(), respectively. These will be discussed in class. The program will implement a “guessing game.?? Ask the user for a number in the range of 1 through 100, inclusive. If the guess is larger than the random number you generated in the range of 1 through 100, inform the user that the guess was too high. If the guess is too low, say so, and when the guess matches the random number, say so! Also, tell the user how many guesses were required. What should you do if the user inputs an invalid guess? Suppose the user enters 0 or 200? You should allow only valid guesses. Therefore, keep asking for guesses until the user enters a number between 1 and 100, inclusive. Run the program 3 times and print the results (note: be sure to use some invalid guesses to test that part of your logic). Remember to print an error message (with the number) when an invalid guess is made. Code a function named, guess(), that will return a number in the range 1 to 100, inclusive. As discussed in class, the function, rand(), will return a random number in the range 0 to MAX, where MAX is a predefined constant (maybe 32767, or ??). Obviously, you must modify the random number to be in the range from 1 to 100, inclusive. Also, random numbers are generated using “seed?? values. Unless you change the seed each time the program is executed, the program will generate the same sequence of random numbers. This makes the game trivial once the user realizes that the random numbers are always the same! To avoid this problem, use srand() to “seed?? the random number generator. You use srand() only once in your program (not in a loop!) to change the seed value. This will cause the program to generate a different sequence of random numbers each time the program is executed! The exact function invocation is:

srand(time(NULL)); //use the system clock to generate a seed

Code the program to allow the user to play the game multiple times and display the average number of guesses at the end of the game. Suppose the user played the game 5 times and the number of guesses for each game was: 7, 4, 5, 5, and 8. The average number of guesses would be: 5.80. Also, allow the user to enter either an uppercase Y or a lowercase y to continue with another game!

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):

a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.

b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.

3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).

## Platform

Must be written in Microsoft Visual c++

Windows 2000

Tentang Majikan:
( 2 ulasan ) Tracy, United States

ID Projek: #3155018

letregrandecoder

See private message.

\$17 USD dalam 4 hari
(38 Ulasan)
4.7

## 35 pekerja bebas membida secara purata \$13 untuk pekerjaan ini

amunsol

See private message.

\$8.5 USD dalam 4 hari
(99 Ulasan)
7.0
vwsolutionsvw

See private message.

\$4.25 USD dalam 4 hari
(11 Ulasan)
6.5
hasnut

See private message.

\$17 USD dalam 4 hari
(193 Ulasan)
6.5
softdesignervw

See private message.

\$25.5 USD dalam 4 hari
(23 Ulasan)
6.3
DanD

See private message.

\$12.75 USD dalam 4 hari
(212 Ulasan)
5.8
vw542790vw

See private message.

\$12.75 USD dalam 4 hari
(64 Ulasan)
5.5
coderhere

See private message.

\$17 USD dalam 4 hari
(28 Ulasan)
5.1
vangelisdimou

See private message.

\$21.25 USD dalam 4 hari
(61 Ulasan)
5.1
bunts007

See private message.

\$17 USD dalam 4 hari
(47 Ulasan)
4.6
lmxvw

See private message.

\$16.15 USD dalam 4 hari
(126 Ulasan)
4.7
starlightsoft

See private message.

\$17 USD dalam 4 hari
(10 Ulasan)
4.1
exceptionalcoder

See private message.

\$21.25 USD dalam 4 hari
(9 Ulasan)
4.1
vw945703vw

See private message.

\$25.5 USD dalam 4 hari
(22 Ulasan)
4.2
gworroll

See private message.

\$12.75 USD dalam 4 hari
(42 Ulasan)
3.7

See private message.

\$12.75 USD dalam 4 hari
(9 Ulasan)
3.5
vw627017vw

See private message.

\$8.5 USD dalam 4 hari
(24 Ulasan)
3.5
thextvw

See private message.

\$8.5 USD dalam 4 hari
(42 Ulasan)
3.4
nsmith100

See private message.

\$6.8 USD dalam 4 hari
(15 Ulasan)
3.3
karsazsoft

See private message.

\$6.8 USD dalam 4 hari
(15 Ulasan)
3.1
paulabramsvw

See private message.

\$11.9 USD dalam 4 hari
(6 Ulasan)
2.9