Random letter generator game : <p>Warning: I am brand new to programing! I am trying to create a random letter generator game for a class project. I feel like I have a decent start to it but I am having difficulty with a few points. </p>

<p>The program is supposed to ask the player how many games they would like to play(1-5). The maximum number of guesses they get per game is 5 and then it is supposed to print out what the correct answer was if it was not guessed. As it is, I have it so that it will run the correct number of guesses but not games and it dosent cout&lt;&lt; the correct answer when all guesses are done. Any help is appreciated, thanks.</p>

<pre><code>#include&lt;iostream&gt;;
#include&lt;cstdlib&gt;;
#include&lt;ctime&gt;;
using namespace std;
int main()
{
    char alphabet [27];
    int number_of_games;
    char guess;
    int x = 1;
    srand(time(0));
    int n = rand() % 26 + 1;  

        cout&lt;&lt;"Weclome to the Letter Guessing game!\n";
        cout&lt;&lt;"You have 5 chances to guess each letter.\n \n";
        cout&lt;&lt;"How many games do you want to play?\n";
        cin &gt;&gt; number_of_games; 

        cout&lt;&lt;"**************************************************\n\n";

    while (x &lt;= number_of_games) //Need to get it for how many rounds, not how many guesses

    {   
        if (number_of_games &lt; 1)
        {
            cout&lt;&lt; "Lets play game " &lt;&lt; number_of_games &lt;&lt; '\n';
        }
        //cout &lt;&lt; (char)(n+97); //cheat to make sure working
        cout&lt;&lt;"Enter your guess: ";
        cin &gt;&gt; guess;
        int guessValue = int(guess);

        if (guessValue &gt; (n+97))
        {
            cout&lt;&lt;"The letter you are trying to guess is before " &lt;&lt;guess &lt;&lt;"\n"; 
        }
        else if (guessValue &lt; (n+97))
        {
            cout&lt;&lt;"The letter you are trying to guess is after " &lt;&lt;guess &lt;&lt; "\n";
        }
        else if(  (char)(n+97))
        {
            cout &lt;&lt; "The answer you were looking for was " &lt;&lt; (char)(n+97) &lt;&lt; "\n";
        }
        else
        {
            cout&lt;&lt;"Your guess is correct! \n";
            break;
        }
        //if answer is not right after x tries, cout the correct answer
        x++;
    }

    system("pause");
    return 0;
}
</code></pre>


