Question
can someone please write the whole program out for me. I need it writen in python 3.6.2. WRITE IT ON HERE FOR ME TL Enterprises
can someone please write the whole program out for me. I need it writen in python 3.6.2. WRITE IT ON HERE FOR ME
TL Enterprises is a newly established car dealership in town. The company has several sales representatives whose weekly compensations are commission-based. That is, sale representatives weekly salary is on commission from sales. To calculate the sales representatives commission, TL Enterprises uses the following:
3% on the first $10,000 of the total sales
2% on the next $20, 000 of the total sales
1% on balance left after deducting $30,000 from total sales
For example, if a Sales Representative A sold $45, 000, the commission will calculated as follows:
First $10,000: 0.03*10000 = $300
Next $20,000: 0.02*20000 = $400
Balance ($45,000- $30,000) = $15,000: 0.01*15000 = $150
Total commission-based gross pay is $850.
The tax and net pay are calculated using the following formula
tax = 20% of (gross pay (number of dependents)*200)
net pay = gross pay tax
For example, using the gross pay above with 2 dependents , tax = .20*(850-2*200) = 0.20*450 = $90
Net pay is $850-$90 = $760
Each sales representative can sell not more than 5 cars per week. There are four different car models and prices:
Model A-$15,000;
Model B-$20,000;
Model C-$18,000;
Model D-$25,000.
To calculate total sales, you must specify the number of cars and the models. For example, if 4 cars were sold, and 2 are of Model A and 2 are of Model C and 1 of Model D, the total sales will be
2*15000 + 2*18000 + 1*25000 = $121,000
You should write the following functions:
get_car_price that accepts as argument a string that represents the model of a car (use A for Model A, B for Model B, C for Model C and D for Model D) and returns the price. Us if statements (15 points)
Hint: A call to get_car_price(B) will return 20000.
calculate_total_sales that will return the total sales. The function will perform the following operations:
Use the number of cars sold and their models to determine the sale price and accumulate the sales prices. Note that number of cars sold should not be more than five (5). If a sale representative sold more than 5 cars, use only the first five cars sold to calculate total sales. No negative numbers. (Use if statement)
Prompt the user to enter the number of car sold by a sales representative, and each car, prompt the user to enter the model (use a for loop), call the function get_car_price to determine the price for the model, add to the total sales (accumulator)
Return the value total of totals. (20 points)
Hint: See call to calculate_total_sales below:
>>>total_sales = calculate_total_sales()
>>>Enter the number of cars sold: 3
>>>Enter the model of car 1: A
>>>Enter the model of car 2: A
>>>Enter the model of car 3: C
>>>print(total_sales)
48000
calculate_tax will accept as arguments the gross pay and the number of dependents, uses the formula above to compute and return the tax. (10 points)
calculate_commission will accept as an argument the total sales, uses the formula above to compute and return the gross pay. (Use if statement) (20 points)
if total sales is less than or equal to 10000, return 3% of total sales
if total sales is less than or equal to 30000, return 3% of 10000 + 2% of (total sales-10000)
if total sales is greater than 30000, return 3% of 10000 + 2% of 20000 + 1% of (totals sales-30000)
calculate_net_pay will accept as arguments the gross pay and number of dependents, uses the formula above to compute with a call to calculate_tax and return the net pay. (15 points)
main that will simulate the program. This function will perform the following operations:
call calculate_total_sales to obtain total sales
call calculate_commission to obtain gross pay
prompt the user to enter the number of dependents that will be passed along with gross pay to the calculate_net_pay.
call calculate_net_pay to obtain net pay
Display the total sales, gross pay and net pay, using 2 decimal places to format the output. (20 points)
Step 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