Time for us to start writing computer games! This first one will be a bit simple, but it's a start. Our task is to write a program that implements a guessing game. Our program generates a random number between 0 and 100. The player must guess the secret number. The program provides hints like "that's too high" or "that's too low" until the player finally guesses the secret number. We will work on this game in three steps. Figure out how to generate a random number within a given range of values. Create a main function that processes one guess from the player, and provides hints. Add what we need to allow for multiple guesses until the player guesses the number. This process of development is called decomposition, which means breaking a task into sub-tasks, each of which is easy to do. Starting with step 1, do a Google search to see how to generate a random number using C++. Try searching on "rand C++". // random.cpp. Maggie Johnson //...
Advanced Microsoft Visual C++ Programming Tutorials, Guide Lines, Examples and more...