i don't know how to get some of the codes. how do u load an array
code
//C++ Program to demonstrate basic array function operations
#include<iostream.h>
const int ARRAY_SIZE = 5;
void LoadArray(int a[ ], int size);
void DisplayFirstToLast(int a[ ], int size);
void DisplayLastToFirst(int a[ ], int size);
int FindMinimumValue(int a[ ], int size);
int FindMinimumIndex(int a[ ], int size);
int FindMaximumValue(int a[ ], int size);
int FindMaximumIndex(int a[ ], int size);
int main()
{
int temp[ARRAY_SIZE];
int i;
int maxValue = -1;
int maxIndex = -1;
int minValue = -1;
int minIndex = -1;
LoadArray(temp, ARRAY_SIZE);
DisplayFirstToLast(temp, ARRAY_SIZE);
minValue = FindMinimumValue(temp, ARRAY_SIZE);
minIndex = FindMinimumIndex(temp, ARRAY_SIZE);
cout << "\n The smallest value in the array is " << minValue << endl;
cout << "\n The index of the smallest value is " << minIndex << endl;
maxValue = FindMaximumValue(temp, ARRAY_SIZE);
maxIndex = FindMaximumIndex(temp, ARRAY_SIZE);
cout << "\n The largest value in the array is " << maxValue << endl;
cout << "\n The index of the largest value is " << maxIndex << endl;
DisplayLastToFirst(temp, ARRAY_SIZE);
return(0);
}
//**************************LoadArray*******************************************
void LoadArray(int a[], int size)
//function prompts user to enter values
//values are stored in consecutive positions in the array
{
//your code goes here
}
//**************************DisplayFirstToLast**********************************
void DisplayFirstToLast(int a[], int size)
//function outputs elements in order of first to last
//note: function does not re-order elements within array
// (positions of array elements remain unchanged)
{
//your code goes here
}
//**************************DisplayLastToFirst**********************************
void DisplayLastToFirst(int a[], int size)
//function outputs elements in order of last to first
//note: function does not re-order elements within array
// (positions of array elements remain unchanged)
{
//your code goes here
}
//**************************FindMinimumValue************************************
int FindMinimumValue(int a[], int size)
//function searches array to find minimum value stored in array
//function returns minimum value to caller
{
//your code goes here
}
//*************************FindMinimumIndex*************************************
int FindMinimumIndex(int a[], int size)
//function searches array to find index of minimum value stored in array
//function returns index of minimum value to caller
{
//your code goes here
}
//*************************FindMaximumValue*************************************
int FindMaximumValue(int a[], int size)
//function searches array to find maximum value stored in array
//function returns maximum value to caller
{
//your code goes here
}
//*************************FindMaximumIndex*************************************
int FindMaximumIndex(int a[], int size)
//function searches array to find index of maximum value stored in array
//function returns index of maximum value to caller
{
//your code goes here
}