Question: Question 2 The main ( ) function template is provided below. You must use the main function template to write the functions that are called

Question 2 The main() function template is provided below. You must use the main function template to write the functions that are called in the main() function to produce these outputs. Your test run output must be exactly the same as specified below or a zero will be given for this question. Sample test runs (user input in blue) Test run 1 Enter the monthly sales: 14550.00 Enter the amount of advanced pay, or enter 0 if no advanced pay was given. Advanced pay: 1000.00 The pay is $746.00 Test run 2 Enter the monthly sales: 9500 Enter the amount of advanced pay, or enter 0 if no advanced pay was given. Advanced pay: 0 The pay is $950.00 Test run 3 Enter the monthly sales: 12000.00 Enter the amount of advanced pay, or enter 0 if no advanced pay was given. Advanced pay: 2000.00 The pay is $-560.00 The salesperson must reimburse the company. Here is the template for the main() function, you must use this main() template, copy and paste into Python IDLE. Requirements for the determine_comm_rate()is found below the template. You are not allowed to change anything in the main function template (add, delete or change). Changing any single piece of code in the given main function template will result in a zero for this question. The main() function must be placed at the bottom after all other functions. Write the get_sales(), get_advanced_pay() and determine_comm_rate() functions # This program calculates a salesperson's pay def main(): # Get the amount of sales from user sales = get_sales() # Get the amount of advanced pay from user. advanced_pay = get_advanced_pay() # Determine the commission rate. comm_rate = determine_comm_rate(sales) # Calculate the pay. pay = sales * comm_rate - advanced_pay # Display the amount of pay. print('The pay is $', format(pay,',.2f'), sep='') # Determine whether the pay is negative. if pay <0: print('The salesperson must reimburse') print('the company.') Q2 continued... Requirements for the function - determine_comm_rate() rate Sales less than 10000.00.10 Sales from 10000.00 to 14999.99.12 Sales from 15000.00 to 17999.99.14 Sales from 18000.00 to 21999.99.16 Sales greater than 21999.99.18

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 Programming Questions!