Help please

I honestly don't know how to code this. If/else, Do/while, while or for loop is hard for me to understand.. :/


Here are the following requirements for Project 1:
Project is called GUESSING GAME

1. Figure out how to output a random number.

2. Secondly ask the user to Enter a Number.

3. The player will have either 5 or 10 attempts to
guess the lucky Random Number. **Please make sure
the Random number is from either 0 to 20**

4. If the user guesses the correct number output
MESSAGE break out of the loop.

5. If the user guesses the wrong number while within
the attempts OUTPUT a message from step #2.

6. If the user have exhaust all of the attempts
OUTPUT a message "You Lose Go Home"(Use your
creativity of what message to output.)

You are required to have:

1. If/else statements

2. Either a Do/while, while or For loop

3. You need comments as well.
Most people learn by doing, or learn by failing and trying again.

Show us what you have.
There are multiple subtasks. Are you sure that you cannot do any of them, or even any part of them?


If I would now mention that the reference documentation for standard library header <random> on this site does on one of its subpages contain a code for "guessing game" as an example, would you promise to not learn anything and blindly copy-paste it to yourself?
closed account (48T7M4Gy)
A comment is any line in the program starting with //
or, multiple lines enclosed with. /* any comment go here */

do{
// lots of work
}while(!assignment_complete);

if(effort_made == 0)
return 0;
else
help_possible.is();
Topic archived. No new replies allowed.