Question: PYTHON: A person in the Civil Service Retirement System can retire at age 55 with at least 20 years of service. A simplified variation for

PYTHON: A person in the Civil Service Retirement System can retire at age 55 with at least 20 years of service. A simplified variation for the computation of the amount of their pension is as follows: In a function calculateAve, calculate the average annual salary for the person's best three years; call it ave. Return ave

In a function percentageRate do the following:

Calculate (number of months)/12 and call it yrs

Calculate percentage rate: 1.5% for each of the first five years, 1.75% for the each of the next five years, and 2% for each addition year. Call it perRate.

Take the minimum of perRate and 80%; call it p. Return p as a decimal.

The amount of the pension is p * ave.

Write a program that requests the input as shown below and calculates the amount of the pension.

The values of ave and p should be computed in functions.

If the input is:

65

448

123456.78

119876.55

107546.45

The output should be:

Enter your age: 65

Enter the number of months of service: 448

Enter first of three highest salaries $123456.78

Enter second of three highest salaries $119876.55

Enter third of three highest salaries $107546.45

Annual pension: $82944.08

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!