Question: Hi, im currently taking a coding class for C code, im new to this and my proffesor just reads powerpoints, so fast like we already

Hi, im currently taking a coding class for C code, im new to this and my proffesor just reads powerpoints, so fast like we already know how to code, we have a homework coming but im 100% lost. id appreciate if someone could help me with this problem and explain (if it isn't too much trouble) the steps and reasoning for the line of code. here is the problem

Sales-Commission Calculator) One large chemical company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9% of $5000, or a total of $650. Develop a program that will input each salespersons gross sales for last week and will calculate and display that salespersons earnings. Process one salesperson's figures at a time. Here is a sample input/output dialog:

Enter sales in dollars (-1 to end): 5000.00

Salary is: $650.00

Enter sales in dollars (-1 to end): 1234.56

Salary is: $311.11

Enter sales in dollars (-1 to end): -1

Your output must include at least the inputs shown above.

Your program should keep asking for input and perform the necessary calculation continuously until a -1 is entered.

Checking if a variable is exactly -1.0 or -1 will not work if a floating-point variable is used to accept user input. The example in the text book uses an integer variable. Be aware. See note below.

It is OK if the program terminates when the user enters any number less than zero. No need to include logic to check only for -1 as the sentinel value.

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!