Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python program to calculate and report cmployee salaries. Depending on the employee's position and the employment date, a salary increment is applied on

image text in transcribed
image text in transcribed
Write a Python program to calculate and report cmployee 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 " " " 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. The program output should be exactly as follows (bold entries are sample input): Enter employee fame: 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 $10000 Do you want to enter another employee (Y/M) ? 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 tedl's eurrent salary should be $8000 Do you want to enter another employee (Y/M)? yess Enter employee name: ali desidero Enter employee base salary: 15000 Enter employee positiona Product Manager Enter employment date = 18.10.2017 All Desidero a current balary ahould be 520000 Do you want to enter another eipployee (Y/N)?Y Enter employee name: david RAX Enter employee base aalary: 13000 Enter employee position: Information Systems Manager Enter employment date =18.10.2009 David Ray' = carrent aalary should be $221000 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/M)? What Can you please enter a valid ansuer. Do you want to enter another employee (Y/N)? yes Enter employee name; eruella de vil Enter employee base salary: 2000 Enter employee position: Dog Caretaker Enter employment date =04.08.2020 Cruella de Vil's current aalary 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions