right now im working on a program that reads a series of numbers (doubles) from the user, then prints the mean and the
range.
also:
• I do not know ahead of time how many numbers will be in the list.
• When ctrl-z if pressed, stop asking for user input
• The numbers will be in the range of 0.0 to 100.0. Ignore numbers outside of this range.
I've tried to think of a way to get the mean and range but it ends up not making sense, and i know the ctrl-z thing has to do with it being 'false' or something? any help is greatly appreciated
#include <iostream>
#include <string>
using namespace std;
int main()
{
double input, answer;
double total = 0;
while (cin >> input)
{
if ((input > 0) && (input < 100));
else
{cout << "out of range; ignored." << endl;}
}
}