share save 2 //Pre-processor directive 3 l#include 4 //Function main begins here
ID: 3602461 • Letter: S
Question
share save 2 //Pre-processor directive 3 l#include 4 //Function main begins here 5 int main() 6- 7 //Declare and initialize both the variables and arrays 8 int arr[11]-(e); 9 double percentage 8.89; 10 int count-e 11 double grossSales; 12 int salary; 13 int employees; 14 //asks user input to input values or to use the sentinel value -1 to end 15 printf("Please enter the gross sales amount or press -1 to ENDIn) 16 //allows integer values user inputs through keyboard 17 scanf("%d",&grossSales;); 18 19 //using while for alternate route if the gross sales anounts were entered and the sentinel value was not used to END 2 while (grosssales -1) ( 21 //Calculation for employees salary earned with 8.89 commission 22 salary 280+ (grosssalespercentage): 23 /wIII print out as float value because money is a decimal value 24 printf("The salary earned is %f ", salary); 25//starts from 2ee to 10ee using and 26 if (salary200 && salaryExplanation / Answer
Here employee is integer variable not array or pointer..
You are using it as employee[] which make sense as array type data accessing so it thowing out error neither array not pointer nor vector..
The statements which through error:
++employees[salary/100];
++employees[10];
Only you need to do.
++employees.
Another error is you forgot to keep } in for loop
for(int count = 0 ; count <=8 ; count++){
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.