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