Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. The main() function is provided, write the functions that are called in the main() function to produce these outputs. >>> ========== RESTART: E:/IVC/CS10 Python/Labs/lab

4. The main() function is provided, write the functions that are called in the main() function to produce these outputs.

>>> ========== RESTART: E:/IVC/CS10 Python/Labs/lab 03-4_commission.py ========== 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 >>> ========== RESTART: E:/IVC/CS10 Python/Labs/lab 03-4_commission.py ========== 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 >>> ========== RESTART: E:/IVC/CS10 Python/Labs/lab 03-4_commission.py ========== 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. >>>

# 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.')

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

=+7 How has the COVID-19 pandemic impacted the operations of IHRM?

Answered: 1 week ago