The game Dungeons and Dragons introduces an element of chance
using a 20-sided die. Sides are marked 1 to 20. When the die is
thrown, the side it comes to rest on has the number that is
used.
a. Use rand( ) in a C++ expression that will have a random value
from 1 to 20.
b. Write a C++ function that returns a random number from 1 to
20.
c. When a program uses rand( ), a statement is used to make sure
that the program produces different random number each time it is
run. Write that statement.
d. Write the #include statements needed in a program that uses
rand( ) and the answer to 1.c.
The game Dungeons and Dragons introduces an element of chance using a 20-sided die. Sides are marked 1 to 20. When the d
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
The game Dungeons and Dragons introduces an element of chance using a 20-sided die. Sides are marked 1 to 20. When the d
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!