Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Python program to calculate and report employee salaries. Depending on the employee's position and the employment date, a salary increment is applied on
Write a Python program to calculate and report employee salaries. Depending on the employee's position and the employment date, a salary increment is applied on the base salary according to the below table. Write the below functions, and a main program that calls the main() function: name_correction() function This function should receive a string containing the name of the employee. It should fix the names, middle names, and surnames such that their first letters are uppercase and all others are lowercase. However, names of "von" or "de" are exceptions; they should remain all in lowercase. salary_increment() function This function should receive employment date, position, and base salary of the employee. It should determine the salary increment amount according to the above table and send it back as its result. main() function Ask for the employee's name, base salary, position and employment date. Call the two functions to process employee name and to determine the salary increment. Print a line on the screen giving the fixed employee name and incremented salary as shown in the sample output. After the employee is processed, the main0 function should ask if the user wants to enter information for another employee. If the first letter of the answer is " y " the program should repeat the same process for another employee. If the first letter is " n " the program should stop. Otherwise the program should issue a warning and keep asking. Do NOT use BREAK, CONTINUE, RETURN or any other statement that prematurely stops a loop or your program. You can use RETURN only for sending back values from your function. Enter employee name: amaia freire sanchez gijon Enter employee base salary: 7500 Enter employee position: Business Analyst Enter employment date =3.6.2002 Amaia Freire Sanchez Gijon's current salary should be \$1 Do you want to enter another employee (Y/N) ? Yes Enter employee name: JOHANNA VON LEDL Enter employee base salary: 8000 Enter employee position: Sales Representative Enter employment date =17.9.2010 Johanna von Ledl's current salary should be \$ 8000 Do you want to enter another employee (Y/N) ? yess Enter employee name: ali desidero Enter employee base salary: 15000 Enter employee position: Product Manager Enter employment date =18.10.2017 Ali Desidero's current salary should be \$20000 Do you want to enter another employee (Y/N)? Y Enter employee name: david RAY Enter employee base salary: 13000 Enter employee position: Information Systems Manager Enter employment date =18.10.2009 David Ray's current salary should be \$21000 Do you want to enter another employee (Y/N)? Maybe Can you please enter a valid answer. Do you want to enter another employee (Y/N)? What Can you please enter a valid answer. Do you want to enter another employee (Y/N) ? yes Enter employee name: cruella de vil Enter employee base salary: 2000 Enter employee position: Dog Caretaker Enter employment date =04.08.2020 Cruella de Vil's current salary should be \$2000 Do you want to enter another employee (Y/N)? NO
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