Do/ While goAgain Loop. Help.

#include <cstdlib>
#include <iostream>
using namespace std ;

// ------------------------------------------------------------------------- //

// Function getUserInput obtains an integer input value from the user.
// This function performs no error checking of user input.
int getUserInput ( )
char goAgain;
{
do
{
int N ;
cout << endl << "Please enter a positive, odd integer value: " ;
cin >> N ;
cout << endl ;
return N ;
} // end getUserInput function

// ------------------------------------------------------------------------- //

// Function printDiamond prints a diamond comprised of N rows of asterisks.
// This function assumes that N is a positive, odd integer.
void printDiamond (int N)
{
for (int i = 1; i <= N; i += 2)
{
for (int j = 0; j < (N - i) / 2; j++)
{
cout << ' ';
}

for (int j = 0; j < i; j++)
{
cout << char(j + 'A');
}

cout << endl;
}

for (int i = N - 2; i >= 1; i -= 2)
{
for (int j = 0; j < (N - i) / 2; j++)
{
cout << ' ';
}

for (int j = 0; j < i; j++)
{
cout << char(j + 'A');
}

cout << endl;
}

}
// ------------------------------------------------------------------------- //

int main ( )
{
printDiamond ( getUserInput() ) ;
cout << "Go again (y for yes, n for no): " ;
cin >> goAgain ;
}
while ( (goAgain == 'y') || (goAgain == 'Y') )
return 0;
} // end main function

// ------------------------------------------------------------------------- //
I can't get it to do the program again. Please help
I reported you for deleting your original question, and leaving pointless text instead. Then the second post was unhelpful & vague.
Topic archived. No new replies allowed.