hello i new to all this
im looking for some help i hope u guys can help me
using namespace std;
double min,sub, max;
const int SIZE =10;
int list[SIZE];
int numbers;
char infile[10];
ifstream in_stream;
cout<<"enter input file name:"<<endl;
cin>>infile;
in_stream.open(infile);
if (in_stream.fail())
{
cout<<"Input file opening failed.\n";
cout <<"Enter input file name.\n";
cin>>infile;
in_stream.open(infile);
}
in_stream>>numbers;
while (!in_stream.eof())
{
in_stream>>numbers;
for (numbers=1;numbers<SIZE; numbers++)
{
cin>>list[numbers];
}
}
cout<<"Enter minimum value:"<<endl;
cin>>min;
cout<<"Enter maximum value:"<<endl;
cin>>max;
if (min>=max )
cout<<"Enter minimum value lower than maximum value ."<<endl;
cin>> min ;
if (max<=min )
cout<<"Enter maximum value greater than minimum value."<<endl;
cin>> max;
cout <<"Values between "<<min<<" and "<< max<<" are :"<<endl;
RIGHT HERE I NEED A CODE THAT WOULD GO Through THE NUMBERS OF THE FILE
AND GET A RANGE FROM MIN TO MAX OUT OF THE ARRAY
HERE I'D POLITELY REQUEST YOU TO... ugh... I'm so not doing this
Seriously macsuma, it's a PITA to write in ALL CAPS, but anyways:
1. what are you trying to do here?
1 2 3 4 5 6 7 8 9 10
while (!in_stream.eof())
{
in_stream>>numbers; // what are the contents of your input file?
for (numbers=1;numbers<SIZE; numbers++)
{
// are you really asking for another input of numbers here?
// or perhaps you want to put the numbers read from your file into the array?
cin>>list[numbers];
}
}
2.
1 2 3 4 5
cout <<"Values between "<<min<<" and "<< max<<" are :"<<endl;
/* here you'd probably want to iterate through the array of numbers,
* do a comparison to min and max
* and outputs those that are within the range
*/