- You will validate input to ensure that the user enters inputs within a certain range or larger than a certain minimum value. You will validate the inputs as follows:
- The user cannot enter a negative number for:
- Miles to kilometers
- Gallons to liters
iii. Pounds to kilograms
- Inches to centimeters
- The user cannot enter a value above 1000 degrees for Fahrenheit to Celsius
- If the user enters an invalid value, then the program will issue an error message and terminate immediately. (Do NOT accept further data).
- Save the program as firstname_lastname_Lab3a.py where you will replace firstname and lastname with your actual first and last name.
- Test all conditions prior to submitting.
Part B: Write Something New!
Write a complete and syntactically correct Python program to solve the following problem:
You are the payroll manager for SoftwarePirates Inc. You have been charged with writing a package that calculates the monthly paycheck for the salespeople. Salespeople at SoftwarePirates get paid a base salary of $2000 per month. Beyond the base salary, each salesperson earns commission on the following scale:
Sales Commission Rate Bonus
<$10000 0%="">$10000>
$10000 – $100,000 2% 0
$100,001 - $500,000 15% $1000
$500,001 - $1,000,000 28% $5000
>$1,000,000 35% $100,000
- The following additional conditions apply:
- If a salesperson has taken more than 3 vacation days in a month, their pay gets reduced by $200
- A salesperson earns a bonus
only
if they have been with the company for 3 months or more
- For salespeople who have been with the company for 5 years or more and who have made sales greater than $100,000 an additional bonus of $1000 is added.
All input to the program will be interactive from the keyboard. The output of the program will include:
- The name of the salesperson
- Their longevity with the company
- Their base salary
- The commission earned (in Dollars)
- The bonus earned
- Additional bonus earned (if any)
- Deductions (if any)
- A total gross paycheck
- Your output should look like a paystub (NOT in paragraph format)
- All currency should be formatted with a $ sign and 2 decimal places
(LO 1, 2, 3).
Use the IDLE programming environment. Please save your file as firstname_lastname_Lab3b.py where you will replace firstname and lastname with your actual first name and last name.
Remember to use the extension .py.
Run and test your program for all conditions. Once you are sure it works you will turn in the items listed in the next section.