Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I tried to run this code in python, and I am expecting the following output. I am getting no prompts or output when I try
I tried to run this code in python, and I am expecting the following output. I am getting no prompts or output when I try to run this code.
Program Output with input shown in bold Enter the monthly sales: Enter the amount of advanced pay, or enter if no advanced pay was given. Advanced pay: The pay is $
Program Output with input shown in bold Enter the monthly sales: Enter the amount of advanced pay, or enter if no advanced pay was given. Advanced pay: The pay is $
Program Output with input shown in bold Enter the monthly sales: Enter the amount of advanced pay, or enter if no advanced pay was given. Advanced pay: The pay is $ The salesperson must reimburse the company.
The code that I am attempting to run is below
### START OF CODE
# This program calculates a salesperson's pay
# at make your own music
def main:
# get the amount of sales
sales getsales
# get the amount of advanced pay
advancedpay getadvancedpay
# Determine the commission rate
commrate determinecommratesales
# calc pay
pay sales commrate advancedpay
# display the amount of pay
printfThe pay is $pay:f
# determine whether the pay is negative
if pay :
printThe salesperson must reimburse'
printthe company'
# the getsales function gets a salesperson's
# monthly sales from the user and returns that value
def getsales:
# get the amount of monthly sales
monthlysales floatinputEnter the monthly sales:
# Return the amount entered
return monthlysales
# The getadvanced pay function gets the amount of
# advanced pay given to the salesperson and returns
# that amount
def getadvancedpay:
# get the amount of advanced pay
printEnter the amount of advanced pay, or
printenter if no advanced pay was given.
advanced floatinputAdvanced pay:
# return amount entered
return advanced
# The determinecommrate function accepts the
# amount of sales as an argument and returns the
# applicable commission rate.
def determinecommratesales:
# determine the commission rate
if sales :
rate
elif sales and sales :
rate
elif sales and sales :
rate
elif sales and sales :
rate
else:
rate
# return the comm rate
return rate
### END OF CODE
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