hello all, i am new to this site and am hoping to find some help here.

i am required to write a program with these specifications:

Write a program that reads a series of numbers (doubles) from the user, then prints the mean and the range.
Notes:
• You do not know ahead of time how many numbers will be in the list.
• When you want to stop entering numbers, enter control‐Z.
• The range is the difference between the lowest and the highest number.
• The numbers will be in the range of 0.0 to 100.0. Ignore any numbers outside of this range.

so far, i have this:
Code:
#include <iostream>
using namespace std;

int main()
{
	double num1 = EOF;

	while (num1 >= 0 && num1 <= 100)
	{cin >> num1;
	if (num1 == EOF) break;
	}


}
i am new to this stuff, and damn it is hard. i dont know if i am on the right track with this, but i am not familiar with using ctrl+z to end the program. any help would be greatly appreciated.