Good day:
My assignment is as follows:
" Use a one-dimensional array to solve the following problem. Read in 1000 numbers, each of which is between 10 and 100, inclusive. As each number is read, print it only if it is not a duplicate of a number already read (and printed). Use the smallest possible array to solve this problem."
I barely but understand arrays..a few questions though.....I have an inFile with the required numbers (1000 numbers between 10 & 100)...
Since it's obvious that the numbers will repeat (though dupilcates should not be printed out), I presume that loops will have to be used(according to my instructor)...b ut how can you use loops when there is no set condition to test statements by? (I hope I stated that correctly).
Any assistance is appreciated. I'll be posting my source code within 24-48 hrs, since i'll need to go read up on this array stuff.
Thanks.
My assignment is as follows:
" Use a one-dimensional array to solve the following problem. Read in 1000 numbers, each of which is between 10 and 100, inclusive. As each number is read, print it only if it is not a duplicate of a number already read (and printed). Use the smallest possible array to solve this problem."
I barely but understand arrays..a few questions though.....I have an inFile with the required numbers (1000 numbers between 10 & 100)...
Since it's obvious that the numbers will repeat (though dupilcates should not be printed out), I presume that loops will have to be used(according to my instructor)...b ut how can you use loops when there is no set condition to test statements by? (I hope I stated that correctly).
Any assistance is appreciated. I'll be posting my source code within 24-48 hrs, since i'll need to go read up on this array stuff.
Thanks.
Comment