Hello,
I'm having an issue with an if/else or maybe just the boolean conditions for it but I'm really stuck. But what my problem is that The print statement "There is no record matching etc..." is being called when it shouldn't so I would assume that 1 is being added t the count in the else if where it shouldn't if the employee muber is found. If feel like I muddled that whole sentence, but I'm not sure how else to explain it. Any help would be great.
Thanks,
Vireyda
Code:
if(FindNumber == expenses[i].emp_num)
{
//prompt user for input from menu to choose field to update
printf("\nWhat would you like to update?");
printf("\nDistance Traveled\t- D or d\nMileage Rate\t\t- R or r\nMeal Costs\t\t- M or m\nQuit to Main Menu\t- Q or q");
fflush(stdin);
scanf("%c", &update);//assign user choice to variable update
//switch to case based on the variable update as defined by the user
switch(update)
{
//ommited for space
}//end swtich
}//end if
else if(FindNumber!=expenses[i].emp_num)//if input employee number does not match any record
++count;//add one to count
}//end for
if (count==i+1)//if count equals i+1
printf("\nThere is no record matching that employee number in the database.\n");