Q:

C++ Guessing Game

#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;

int main();
void Menu();
void PlayGame();
void Again();

int main()
{
// Seed the random number generator
srand(time(0));
Menu();
return 0;
}

// Menu so can keep playing or close the program
void Menu()
{
int selection = 0;
bool playing = true;

while (playing)
{
    cout << "Guess Number Game\n\n";
    cout << "Menu\n\n";
    cout << "1) Play Game\n";
    cout << "2) Exit\n\n";
    cout << "Enter your selection: ";
    cin >> selection;
    cin.ignore();
    cout << endl;

    if (selection == 1)
       PlayGame();
    else if (selection == 2)
        playing = false;
    else if (selection != 1 || 2) //lets the user know why they are going        back to the menu
        cout << "Try again, choose 1 or 2" << endl;
  }

}

void PlayGame()
{
int RandomNumber = rand() % 50 + 1; // to set the random number between 1-50
int attempts = 15; // sets attempts at guessing the number to 15
int guess;
const int HighestNum = 50;
const int LowestNum = 1;

cout << "Guess the random number between 1 and 50!\n";

while (true)
{
    cout << "You have " << attempts << " attempts remaining\n\n"; // so the      user can keep track of attempts
    cout << "Enter a number: ";
    cin >> guess;
    cin.ignore();
    cout << '\n';

    if (guess == RandomNumber)
    {
        cout << "Congratulations, you won: " << RandomNumber << "!";
        cout << "\n\n" << endl;
        cout << "Would you like to play again y or n?" << endl;
        cin.get ();
        void Again();
    }
    else if (guess < RandomNumber) // to satisfy requirements of showing user whether the guess is too low
    {
        cout << "That guess is too low!\n" << endl;
    }
    else if (guess > RandomNumber)// to satisfy requirements of showing user whether the guess is too high
    {
        cout << "That guess is too high!\n" << endl;
    }
    else if (guess > HighestNum || guess < LowestNum)
    {
        cout << "Guess must be lower than 50 and higher than 1, Try again"     << endl; //setup so guesses not within the range of 1-50 do not count against the 15 guesses
        cin.get();//remove this to count guesses that are outside the 1-50
    }
    attempts--;

    if (attempts == 0)
    {
        cout << "Sorry, no guesses remain. The random number was... " <<     RandomNumber << "!";//so the user can see the random number at the end of their attempts
        cout << "\n";
        cin.get();
        void Again();
    }
}
void Again();
{
int decision = 0;
bool TryAgain = true;
char y;
char Y;
char n;
char N;

while (TryAgain)
{
    cout << "Y) Play Again\n";
    cout << "N) Exit\n\n";
    cout << "Enter your selection: ";
    cin >> decision;
    cin.ignore();
    cout << endl;

    if (decision == y || decision == Y)
    {
       PlayGame();
    }
    else if (decision == n || decision == N)
    {
        TryAgain = false;
    }
    else if (decision != y, Y || n, N) //lets the user know why they are going back to the menu
    {
        cout << "Try again, choose y or n" << endl;
    }
}
return

Trying to get the void Again (); to read from the void PlayGame();. Using the void Again (); to ask the user if they want to play again. Please Help!
Could also use someone help to change the function to have the prototype int reviewGuess(int, int), where the function takes the random number generated by the computer as the first parameter and the number guessed by the user as the second parameter. 

If the numbers match, the function will return a value of zero. 
If the number is too high, the function will return a value of 1. 
If the number is too low, the function will return a value of -1. 

Rather confused ATM.
Thank you,

A:

First off you should fix the issues which Alde has mentioned. Next off what's up with the while (true) statement? You should probably replace it with while (attempts != 0) and set the:
if (attempts == 0) {
    cout << "Sorry, no guesses remain. The random number was... " << RandomNumber 
        << "!";//so the user can see the random number at the end of their attempts
    cout << "\n";
    cin.get();
    void Again();
}

out of the while scope.
And about your int reviewGuess(int, int) function,are you looking for something like this:
int reviewGuess(int randomNumber,int userChoice)
{
    if(randomNumber == userChoice)
       return 0;
    if(userChoice > 50)
       return 1;
    if(userChoice < 1)
       return -1;
}

