I'm writing a program for my C++ class that goes off of a previous assignment. The previous assignment asked the user how many numbers they wanted to enter, asked them to then enter the numbers and then found the sum, average, largest and smallest number from the inputted numbers. The current assignment is asking us to take what we had for code in the previous assignment, but instead, ask the user for a number from 1 to 100, ask if they would like to enter another number (y or n), if yes, they enter another number, if no, the loop ends. Then, state how many numbers the user input, find the sum, average, largest, smallest of the inputted numbers. I'm having trouble figuring out the code. Heres what I had for the previous assignment:

```
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int UserInput, number, i;
int sum = 0;
float average = 0;
int largest = 0;
int smallest = 0;
cout << "How many numbers do you wish to enter? ";
cin >> UserInput;
for (i = 0; i < UserInput; i++)
{
cout << "Enter a number: ";
cin >> number;
sum = sum + number;
average = float(sum)/UserInput;
if (number > largest)
largest = number;
if (!i || smallest > number)
smallest = number;
}
cout << "The sum is: " << sum << endl;
cout << "The average is: " << average << endl;
cout << "The largest is: " << largest << endl;
cout << "The smallest is: " << smallest << endl;
getch();
return 0;
}
```

and this is what I currently have for the newest assignment:

```
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int UserInput, number, i;
int sum = 0;
float average = 0;
int largest = 0;
int smallest = 0;
cout << "Enter a number from 0 to 100: ";
cin >> UserInput;
for (i = 0; i < UserInput; i++)
{
cout << "Enter a number: ";
cin >> number;
sum = sum + number;
average = float(sum)/UserInput;
if (number > largest)
largest = number;
if (!i || smallest > number)
smallest = number;
}
cout << "The sum is: " << sum << endl;
cout << "The average is: " << average << endl;
cout << "The largest is: " << largest << endl;
cout << "The smallest is: " << smallest << endl;
getch();
return 0;
}
```

Note: We are not supposed to change much from the previous assignment.