Menu

Need Limit Array 100 Values User Goes Limit Would Prompt Exceeded Limit Code Complies Sort Q43882375

I need to limit an array to 100 values and if a user goes overthat limit, it would prompt them they had exceeded the limit.
The code complies but it just sorts the array as-is so it doesntnotice there was more then 100 floating point values.

int ARRAY_SIZE = 100; //array size is 100 max
float numbers [ARRAY_SIZE], value;
char ch;
int count = 0;
ifstream inputFile; //input file steam object
inputFile.open(“floatnumbers.txt”);
while ( count < ARRAY_SIZE && inputFile >> numbers[count])
count++;
{
if ( ARRAY_SIZE > 100)
{
cout << “You have Exceeded array limit” <<endl;
return 0;
. }
else if (ARRAY_SIZE[numbers] <= 100)
{
.
.
(rest of code)

Expert Answer


Answer to I need to limit an array to 100 values and if a user goes over that limit, it would prompt them they had exceeded the li…

OR