Please Help Stuck

This Problem Im stuck on anyone know how to do this?

Using a loop with error trapping/validation, ask user for a number between 10-15. Allocate an array
with the user provided number of elements and fill it with a random number between 1 and 100
using a single for-loop. Output the array in reverse order using another for-loop. Dispose of the
array when done



int userNum = 0;
int ary[]{14,24,13,5,66,32,21,45,6,4,33,22,42,5,44,33,22,42,55,34,22};
{
cout << "Enter a Number Between 10-15" << endl;
cin >> userNum >> endl;
while{

if(userNum == 10 = ary[10]);
else if (userNum == 11 = ary[11]);
else if (userNum == 12 = ary[12]);
else if (userNum == 13 = ary[13]);
else if (userNum == 14 = ary[14]);
else if (userNum == 15 = ary[15]);
else if (userNum <= 9 || userNum >= 16)
cout << "Error Incorrect Input Please Enter A Number Between 10 and 15" << endl;





Am I on the right track?
Last edited on
Please note, that this is not a homework site. We won't do your homework for you. The purpose of homework is that you learn by doing. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.

We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again.


The task description contains plenty of hints.
Topic archived. No new replies allowed.