Sep 27, 2016 at 5:15pm UTC
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.
Sep 27, 2016 at 7:04pm UTC
Most people learn by doing, or learn by failing and trying again.
Show us what you have.
Sep 27, 2016 at 9:12pm UTC
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?
Sep 27, 2016 at 9:26pm UTC
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();