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...



  1. 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:

  2. The user cannot enter a negative number for:

  3. Miles to kilometers

  4. Gallons to liters


iii. Pounds to kilograms



  1. Inches to centimeters

  2. The user cannot enter a value above 1000 degrees for Fahrenheit to Celsius

  3. If the user enters an invalid value, then the program will issue an error message and terminate immediately. (Do NOT accept further data).

  4. Save the program as firstname_lastname_Lab3a.py where you will replace firstname and lastname with your actual first and last name.

  5. 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 – $100,000 2% 0


$100,001 - $500,000 15% $1000


$500,001 - $1,000,000 28% $5000


>$1,000,000 35% $100,000




  1. The following additional conditions apply:

  2. If a salesperson has taken more than 3 vacation days in a month, their pay gets reduced by $200

  3. A salesperson earns a bonus
    only
    if they have been with the company for 3 months or more

  4. 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:




  1. The name of the salesperson

  2. Their longevity with the company

  3. Their base salary

  4. The commission earned (in Dollars)

  5. The bonus earned

  6. Additional bonus earned (if any)

  7. Deductions (if any)

  8. A total gross paycheck

  9. Your output should look like a paystub (NOT in paragraph format)

  10. 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.

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here