Problem

For games to hold your interest, they almost always include some random,unpredictable be...

For games to hold your interest, they almost always include some random,unpredictable behavior. For example, a game in which you shoot asteroids losessome of its fun if the asteroids follow the same, predictable path each time you play.Therefore, generating random values is a key component in creating most interestingcomputer games. Many programming languages come with a built-in module you can use to generate random numbers. The syntax varies in each language, but it is usually something like the following:

In this statement, is a numeric variable you have declared and the expression random(10) means “call a method that generates and returns a random number between 1 and 10.” By convention, in a flowchart, you would place a statement like this in a processing symbol with two vertical stripes at the edges, as shown below

Create a flowchart or pseudocode that shows the logic for a program that generates a random number, then asks the user to think of a number between 1 and 10. Then display the randomly generated number so the user can see whether his or her guess was accurate. (In future chapters, you will improve this game so that the user can enter a guess and the program can determine whether the user was correct.)

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 2
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT