Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use the following schedule to calculate the monthly income of a salesperson. Acc

ID: 3641332 • Letter: U

Question

Use the following schedule to calculate the monthly income of a salesperson. Accept user input for the value of the monthly sales. Using if-else to calculate income. Save the value of the income to a text file named salesincome.txt. Open the file in append mode after the first successful attempt and observe the change.

Monthly Sales Income

Greater than or equal to $50,000 $375 plus 16% of sales

Less than $50,000 but greater than $350 plus 14% of sales
or equal to $40,000

Less than $40,000 but greater $325 plus 12% of sales
than or equal to $30,000

Less than $30,000 but greater than $300 plus 9% of sales
or equal to $20,000

Less than $20,000 but greater $250 plus 5% of sales
than or equal to $10,000

Less than $10,000 $200 plus 3% of sales

Explanation / Answer

#include void main() { char empname[80],month[70]; long int sales; float income; FILE *fp; fp=fopen("d:salesincome.txt","a"); if(fp==NULL) fp=fopen("d:salesincome.txt","w"); printf("ente name of the sales person "); scanf("%s",empname); printf("name of the month ? "); scanf("%s",&month); printf("enter sales in dollars "); scanf("%ld",&sales); if(sales