Question: PLEASE HELP me figure out what is wrong with this code. This my code PLEASE just edit my code. When i run the code it

PLEASE HELP me figure out what is wrong with this code.

PLEASE HELP me figure out what is wrong with this code. ThisThis my code PLEASE just edit my code. When i run the code it just keeps asking to enter the salary without showing the output correctly. I dont know what i did wrong but i think its the for loop. PLEASE HELP me and make it as simple as possible

#include

int main()

{

int numEmp = 0;

int count[9]={0,0,0,0,0,0,0,0,0};

int gross;

printf("Enter the number to employees: ");

scanf("%d", numEmp);

for (numEmp=0; numEmp

printf("Enter a gross amount or to EXIT enter -1: ");

scanf("%d",&gross);

if((gross*0.09+200>=200) && (gross*0.09+200)

count[0]++;

else if((gross*0.09+200>=300) && (gross*0.09+200)

count[1]++;

else if((gross*0.09+200>=400) && (gross*0.09+200)

count[2]++;

else if((gross*0.09+200>=500) && (gross*0.09+200)

count[3]++;

else if((gross*0.09+200>=600) && (gross*0.09+200)

count[4]++;

else if((gross*0.09+200>=700) && (gross*0.09+200)

count[5]++;

else if((gross*0.09+200>=800) && (gross*0.09+200)

count[6]++;

else if((gross*0.09+200>=900) && (gross*0.09+200)

count[7]++;

else if(gross*0.09+200>=1000)

count[8]++;

while(gross!=-1);

int i=0;

for(i=0;i

printf("Count[%d] is %d ",i,count[i]);

return 0;

}

5 Use a single-subscripted array to solve the following problem. A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who grosses $3000 in sales in a week receives $200 plus 9 percent of $3000, or a total of $470. Write a C program (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is truncated to an integer amount): a) $200-299 b) $300-399 C)$400-499 d) $500-599 e) $600-699 f) $700-799 g) $800-899 h) $900-999 i) $1000 and over

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!