Wednesday, July 14, 2021

Salepersons Salary Commission Solver in Python

 Machine Problem in Python

Write a program code that allows the user to input values for a salesperson' base salary, total sales and  commission rate. The program calculates and displays the  salesperson's pay by adding the base salary  to the product of the total sales and commission rate.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.





Program Listing


# mod1_act2.py
# Author : Jake R. Pomperada
# This program calculates salespersons salary.
# Create a variable to control the loop.

retry = "Y"

while retry.upper() == "Y":
# Calculate a series of commissions.
base_salary = float(input('Enter the salespersons base salary: '))
sales = float(input('Enter the amount of total sales: '))
comm_rate = float(input('Enter the commission rate: '))

# Calculate the commission.
commission = sales * (comm_rate /100)
# Calculate the salespersons salary
solve_salary = (base_salary + commission)

# Display the salespersons salary
print()
print( 'Salespersons salary is PHP %.2f' % solve_salary)
# See if the user wants to do another one.
print()
retry = str(input("Would you like to try again? (Y-Yes and N-No) : "))
print()
if retry.upper() == "N":
break
elif retry.upper() == "Y":
continue
print()
print("End of Program")
print()

No comments:

Post a Comment