Question: Python Exercise Commission Objectives: Practice while-loop. You are asked to write a program to calculate sales commission for each sales person, and to accumulate a
Exercise Commission Objectives: Practice while-loop. You are asked to write a program to calculate sales commission for each sales person, and to accumulate a total. For of all, you are requested to write a function with the following header to do processing for an individual sales person: def processOneEmp 0: The amount, displays such information on screen, and finally returns the computed commiss processOneEmp shall prompt for three data for an employee, including employee's name, sales and commission percentage rate. it then calculates commission for the specific sales person, ion You then proceed to define the main function of the program. In the main, you'll write a loop to repetitively process the data for an employee and keep a running total of commissions. iteration of the loop, you should call the previously defined function processoneEmp. The statement in the loop body is to ask users whether there is more employee data to be processed. The user can press any key on keyboard to give an answer. The loop would continue only if the user types in y or Y as an answer. Once the loop exits, the total commissions to be paid by the company shall be displayed on screen. n each last Finally, don't forget to make the program run by invoking the main function with the following statement: if name"main" main) An example interactive session is illustrated as follows where users' inputs are underlined: What is the employee's name? Julie Enter the sales for Julie $20000 Enter the commission percentage rate for Julie: 4 Julie earned $800.0 in commissions Is there another employee? Enter y for yes y What is the employee's name? Kai Enter the sales for Kai $30000 Enter the commission percentage rate for Kai: 2.5 Kai earned $750.0 in commissions Is there another employee? Enter y for yes n Total commissions $1550.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
