Just starting my Programming C++ resit work and I've forgot most of it
Anyway, I wonder if someone can give this a quick check over for me to see if I'm on the right track?
I've been asked the following question:
This is what I've come up with:
Does that seem OK? Be gentle with me, I really suck at C++

Anyway, I wonder if someone can give this a quick check over for me to see if I'm on the right track?
I've been asked the following question:
1. Write a C++ function, called inputValidNumber, which prompts the user for a value in a given range, reads in a number, checks that it is in a range specified and returns it. While the value read in is not in the specified range, the system repeatedly asks for another one until a valid value is input.
The function takes 2 parameters respectively representing the minimum and maximum value of the valid range (both inclusive).
For example, the following statement sets the value of a variable number to the first number input by the user that is greater than or equal to 1 and less than or equal to 20.
int number = inputValidNumber( 1, ROWS);
This is what I've come up with:
Code:
void inputValidNumber ( minValue, maxValue)
int enteredNumber;
{
cout << “Enter a value between “ << minValue << “and “ << maxValue;
cin >> enteredNumber;
while ( enteredNumber >= minValue && =< maxValue)
cout << enteredNumber;
}
Does that seem OK? Be gentle with me, I really suck at C++
