Alright the following things is for homework however I am not asking from someone to do it. I am merely asking for a guidance i've already asked my tutort but he just keeps saying that "i've provided you with everything you need" He hasn't even taught us anything all he does is give a code to look at then a week after a new homework. - Sorry for the rant.
Code:
#include <stdio.h>#include <stdlib.h>
int main(int argc, char *argv[])
{
//Enter the values into the array
int arnSalaries[10][2] = {21, 10000, 22, 15600, 23, 10000, 24, 56000,
25, 13250, 26, 24750, 27, 18750, 28, 56250,
29, 22450, 30, 27500};
int nRow, nCol;
int nEmSal;
char cFound = 'N';
nCount = 0;
nMin = 9999;
nMax = 0;
nInputVal = 0;
printf(" Array Task 5\n\n");
//Display the array
for(nRow = 0; nRow < 10; nRow++)
{
printf("%4d %6d\n",arnSalaries[nRow][0], arnSalaries[nRow][1]);
}
printf("\n\n");
printf("Please enter the salary : ");
scanf("%d", &nEmSal);
funcSearch (arnSalaries, nEmSal);
system("PAUSE");
return 0;
}
int funcSearch(int arnSalaries[10][2],int nEmSal)
{
int nRow, nCol;
char cFound = 'N';
for(nRow = 0; nRow < 10; nRow++)
{
if(nEmSal == arnSalaries[nRow][1])
{
printf("\nEmployee found - has an employee number of %d\n", arnSalaries[nRow][0]);
cFound = 'Y';
nRow = 10; /* This is to break out of the loop */
}
}
if(cFound == 'N')
{
printf("Sorry, employee not found - please try again\n");
}
}
okay i need hints or something to work with on how can i go about modifying the search function i created so that i can input two set of numbers (for minimum and maximum) then it will display the salary within that range.
p.s I'm not at all that clever so please explain things in Standard english
Thank you!