ARRAY

Is a data structure consisting of a group of elements that are accessed by indexing. In most programming languages each element has the same data type and the array occupies a contiguous area of storage. Most programming languages have a built-in array data type.

 The usefulness of ARRAYS


The use of arrays allows us to efficiently find the minimum and maximum net pay of all employees as well as sort the employees based on their net pay (ascending order).

void fill(apvector <int>&netpay);
int maxnetpay (apvector <int>& netpay);
int minnetpay (apvector <int>& netpay);
void print_It(apvector <int>& netpay);

int main(void)
{
system ("CLS");
apvector <int> netpay ();

//Call function to fill the array
fill(netpay);

//Call function to print the array
print_It(netpay);

//Call function to find max
int maximum = maxnetpay (netpay);

//Call function to find min
int minimum = minnetpay (netpay);

cout<< "The highest netpay in the array is "<<maximum<<".\n";
cout<< "The lowest netpay in the array is "<<minimum<<".\n";
cout<<endl<<endl;
return 0;
}

Hosted by www.Geocities.ws

1