# I need help with a C++ assignment: Write a program containing the following: 1. Variable Definitions...

###### Question:

I need help with a C++ assignment:

Write a program containing the following:

1. Variable Definitions only as (DieRoll, Guess, cnt1, cnt2) followed by this statement:

srand((unsigned int)time (NULL));

which will give the random number generator a random starting point.

Note: srand and rand require the TIME.H (or iomanip)

cnt1 and cnt2 will be used in Chapter 5 drop box as counters for loops. Do NOT create additional variables. Points will be taken off for any additional variable creation.
2.   Prompt the user for a whole number between 1 and 6.
3. Accept user input of the number – use Guess as the variable
4. Simulate rolling a die with the following code (DieRoll variable is defined in 1):
DieRoll = rand()%6+1;    //Note: rand is a function returning 0 thru 32767.
5.  Display Guess and DieRoll on the Screen with good user labeling information. Additionally, display”WINNER” if Guess and DieRoll are equal.
6.  Display “DOUBLE WINNER” if DieRoll is an odd number (use modulo). Not related to question 5 above.
7. If the DieRoll added to the Guess is greater than or equal 10 and DieRoll is even Display “YOU ARE A LUCKY PERSON”. This is unrelated to the previous requirements.

8.  Create a for loop to print the numbers 1 thru 5, all on the same line.

9.  On the next output line create a for loop which will count backwards by 1’s from 100 to 0 (inclusive of 100 and 0) only displaying every number which is evenly divisible by 17.

10. Write a while loop to do the same as 9.

11. Write a do…while loop to:
a. ask the user for a number   ( use the variable Guess).
b.   get user input.
c.   tell the user the remainder of dividing the number by 5 (modulo) even if result is 0.
d.   continue the loop until the user enters zero (0) as the number. (Make sure the user is aware of this.)
Organize the loop like this (this is a planning technique called pseudocode):
do
{
prompt the user for a  (a. above)
get user input (b. above)
output to user (c. above)
}while   (your test goes here to see if the number is 0);
12.      Create a for loop within a for loop. The outer loop will count from 1 to 5. The inner loop will count from 1 to 6 and write the product of the outer loop counter multiplied by the inner loop counter, all on the same line with one tab (‘\t’) between. Between the loop ends put a line feed (endl or \n). The result should look like this:
1          2          3          4          5          6
2          4          6          8          10         12
3          6          9          12         15         18         etc,

#### Similar Solved Questions

##### 2 hours 13/50 Pens and pencils are substitutes. The price of pens drops by 15%. How...
2 hours 13/50 Pens and pencils are substitutes. The price of pens drops by 15%. How does this affect the market for pencils? In the graph below, show how the market for pencils is impacted by this change by shifting the appropriate curve. Provide your answer below: Price of Pencils Supply Next > ...
##### A 1.0 mm -diameter, 20 cm -long copper wire carries a 4.5 A current. What is...
A 1.0 mm -diameter, 20 cm -long copper wire carries a 4.5 A current. What is the potential difference between the ends of the wire?...
##### Basic Physics PHY 114 W-01 Department of Physical and Computer Sciences Medgar Evers College Assignment 2...
Basic Physics PHY 114 W-01 Department of Physical and Computer Sciences Medgar Evers College Assignment 2 Name: Write or type work and solutions on a separate paper. If written, write legibly. 1. The velocity of a car decreases from 30 m/s to 18 m/s in a time of 1 minute. What is the average acceler...
##### Step by step please. box in answer. 3. ÷, 0-10 points l Previous Answers SerPSEI0 11...
step by step please. box in answer. 3. ÷, 0-10 points l Previous Answers SerPSEI0 11 1P003 My Notes Ask Your Teacher If I, X -TE, what is the angle between Ã and ? Your response differs from the correct answer by more than 100%...
##### How not teaching patients of how to clean their teeth will affect my professional life as...
how not teaching patients of how to clean their teeth will affect my professional life as a dental hygienist...
##### Please help me! You have identified a new transporter involved in the movement of sodium and...
Please help me! You have identified a new transporter involved in the movement of sodium and calcium. Describe an experiment to determine whether this transporter is a pump or a secondary transporter. –Key difference: A pump requires energy that is not coupled to a concentration gradient. Seco...
##### Conclusion topic: Describe how we know that molecules actually have the shapes that you have described...
Conclusion topic: Describe how we know that molecules actually have the shapes that you have described in this experiment. Also, if we have a molecule that has resonance, like ozone, how do we know that the bonds are actually not purely single bonds or purely double bonds (HINT: think bond lengths!)...
You are given a PM as shown below: START READ READ2 ACCEPT b ADD a READ ADD Using the approach discussed in the lecture video or follow the example in the textbook from page 459 to page 461, trace the paths of the following input strings on this PM: "aabbbb". At every step, name the current ...
##### 5. You observed that the time your friend Alice talks on a phone conversation is exponentially...
5. You observed that the time your friend Alice talks on a phone conversation is exponentially distributed with mean 5 minutes. You call her one morning and her line is busy. Assuming that she is in a phone conversation: (a) (8.5 pts) What is the probability that she would finish the conversation in...