Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python program with while loop Practice while loop You are asked to write a program to calculate sales commission for each sales person, and to
Python program with while loop
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 processOne Emp (O) : The processOneEmp shall prompt for three data for an employee, including employee's name, sales amountand commission percentage rate. It then calculates commission for the specific sales person. displays such information on screen, and finally returns the computed commission. You then proceed to define the main function of the program. In the main, youll write a loop to repetitively process the data for an employee and keep a running total of commissions. In each iteration of the loop, you should call the previously defined function processOne Emp. The last statement in loop is ask users whether there employee to be processed. The the body to is more data user can press any key on keyboard to give an answer. The loop would continue only if the user types in y the loop to be by ory as an answer. Once exits, the total commissions paid the company shall be displayed on screen . Finally, don't forget to make the program run by invoking the main function with the following statement: main ": l name 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 Kai2.5 Kai earned $750.0 in commissions Is there another employee? Enter y for yes n Total commissions = $1550.0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started