I have an array of strings, which allow a user to enter a name for the staff member, the amount they get paid and the hours they have worked. I want to multiply the pay by the hours (pay * hours, eg. $15.90 x 21hrs). I am confused on how to do this. The code I have so far is below.
Code:
#include<stdio.h>
int main (void)
{
/*declare variables */
int index1, index2;
char staff[20][3][50];
/*Allow a user to enter staff's details*/
printf("Please enter the staff's name, pay classification (in $) and hours worked.\n");
for (i = 0; i < numRows; i++)
{
for (j = 0; j < numCols; j++)
{
scanf("%s", staff[i][j]);
}/*end (for (j = 0; j < numCols; ++j))*/
putchar('\n');
}/*end (for (i = 0; i < numRows; ++i))*/
printf("\n\n Name: %s, Pay class: %s, Hrs: %s\n", staff[0][0], staff[0][1], staff[0][2]);
return 0;
}