Виконано

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

Навички: Програмування на С, Техніка, MySQL, PHP, Архітектура ПЗ, Тестування ПЗ

Деталі: use srand makes program work, 100 guessing game, windows game programming, what is game programming, what is an assignment problem, what is a loop in programming, what is a class in programming, web game programming, test code generator, rand c programming, programming with game, programming what is a class, programming loop, max programming hire, loop programming, hire game programming, hire game code, hire a coder for your game, generator logic, game coder for hire

Про роботодавця:
( 2 відгуки(-ів) ) Tracy, United States

ID Проекту: #3155018

Доручено:

letregrandecoder

See private message.

$17 USD за 4 дні(-в)
(38 відгуків(-и))
4.7

35 фрілансерів(-и) у середньому готові виконати цю роботу за $13

amunsol

See private message.

$8.5 USD за 4 дні(-в)
(99 відгуків(и))
7.0
vwsolutionsvw

See private message.

$4.25 USD за 4 дні(-в)
(11 відгуків(и))
6.5
hasnut

See private message.

$17 USD за 4 дні(-в)
(193 відгуків(и))
6.5
softdesignervw

See private message.

$25.5 USD за 4 дні(-в)
(23 відгуків(и))
6.3
DanD

See private message.

$12.75 USD за 4 дні(-в)
(212 відгуків(и))
5.8
vw542790vw

See private message.

$12.75 USD за 4 дні(-в)
(64 відгуків(и))
5.5
coderhere

See private message.

$17 USD за 4 дні(-в)
(28 відгуків(и))
5.1
vangelisdimou

See private message.

$21.25 USD за 4 дні(-в)
(61 відгуків(и))
5.1
bunts007

See private message.

$17 USD за 4 дні(-в)
(47 відгуків(и))
4.6
lmxvw

See private message.

$16.15 USD за 4 дні(-в)
(126 відгуків(и))
4.7
starlightsoft

See private message.

$17 USD за 4 дні(-в)
(10 відгуків(и))
4.1
exceptionalcoder

See private message.

$21.25 USD за 4 дні(-в)
(9 відгуків(и))
4.1
vw945703vw

See private message.

$25.5 USD за 4 дні(-в)
(22 відгуків(и))
4.2
gworroll

See private message.

$12.75 USD за 4 дні(-в)
(42 відгуків(и))
3.7
aditsu

See private message.

$12.75 USD за 4 дні(-в)
(9 відгуків(и))
3.5
vw627017vw

See private message.

$8.5 USD за 4 дні(-в)
(24 відгуків(и))
3.5
thextvw

See private message.

$8.5 USD за 4 дні(-в)
(42 відгуків(и))
3.4
nsmith100

See private message.

$6.8 USD за 4 дні(-в)
(15 відгуків(и))
3.3
karsazsoft

See private message.

$6.8 USD за 4 дні(-в)
(15 відгуків(и))
3.1
paulabramsvw

See private message.

$11.9 USD за 4 дні(-в)
(6 відгуків(и))
2.9