Question

This question uses matlab R2018a

Retirement.m is ->

function [MyCont, CompCont, Total] = retirement(salary)

if salary <= 30000
MyCont = 0.1 * salary;
CompCont = 0.1* salary;
elseif salary <= 60000
MyCont = 0.1*salary;
CompCont = 0.1 * 30000 + 0.05 * (salary - 30000);
elseif salary <= 100000
MyCont = 0.1*60000 + 0.08 * (salary-60000);
CompCont = 0.1*30000 + 0.05*30000;
else
MyCont = 0.1*60000 + 0.08 * 40000;
CompCont = 0;
end

Total = MyCont + CompCont;
  
  Many large companies encourage their employees to contribute a portion of their salary toward their 401(K) savings plan by matching employees contribution to a certain percentage. Saving is tax-free before it is actually used. Hence, government puts a maximum pre-tax money that could be saved in a 401(K) plan. Following table show the percentage of tax-free salary that each employee can save based on the salary tiers, and the companys contribution toward the saving Salary range Max you can save tax free Maximum that company will match 10% 10% of the first $30,000 and 5% Up to $30,000 10% Between $30,000 and $60,000 10% of the amount above $30,000 Between $60,000 and $100,000 | 10% of the first $60,000 and 8% | 10% of the first $30,000 and 5% of the amount above $60,000 of the amount between $30,000 and $60,000; nothing for the remainder above $60,000 10% of the first $60,000 and 896 | Nothing-highly compensated of the amount between $60,000 employees are exempt from and $100,000; nothing on the this plan and participate in amount above $100,000 Above $100,000 stock options instead Write a function (called retirement) that takes your salary as input, and return savings in your 401(K) in terms of your contribution, your companys contribution, and total annual savings. (10 points) I. Use the function retirement.m in a “while loop to determine how many years you should work with a starting salary of $45,000, given the fact that you are entitled to a raise of 1% in salary each year, to save $50,000 in your 401(K) savings plan. (10 points) Hint: You would need to define the threshold of while loop based on the total of $50,000 savings. You will also need a counter variable defined before while loop, which in turn increases (counter counter 1) each time the loop goes through.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB code:

main file:

clc;
close all;
clear all;

salary = 45000;
counter = 0;savings = 0;
while(savings<50000)
[MyCont, CompCont, Total] = retirement(salary);
savings = savings+Total;
salary = salary*1.01;% increase in salary by 1%.
counter = counter+1;
end

called file:

function [MyCont, CompCont, Total] = retirement(salary)

if salary <= 30000
MyCont = 0.1 * salary;
CompCont = 0.1* salary;
elseif salary <= 60000
MyCont = 0.1*salary;
CompCont = 0.1 * 30000 + 0.05 * (salary - 30000);
elseif salary <= 100000
MyCont = 0.1*60000 + 0.08 * (salary-60000);
CompCont = 0.1*30000 + 0.05*30000;
else
MyCont = 0.1*60000 + 0.08 * 40000;
CompCont = 0;
end

Total = MyCont + CompCont;

Result:

>> counter

counter =

6

Number of years to get to the savings figure is 6 years

Add a comment
Know the answer?
Add Answer to:
This question uses matlab R2018a Retirement.m is -> function [MyCont, CompCont, Total] = retirement(salary) if salary...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For each taxpayer, compute the maximum contribution to the retirement plan. a. Lewis, a self-employed individual,...

    For each taxpayer, compute the maximum contribution to the retirement plan. a. Lewis, a self-employed individual, has net earned income of $50,000 in 2018. If Lewis has no employees, calculate the maximum contribution to a SEP plan that he may deduct from his adjusted gross income. $_____________ b. During 2018, Linda, age 32, has a salary of $40,000. She participates in a Section 401(k) plan and chooses to defer 25 percent of her compensation. What is the maximum amount Linda...

  • federal income tax question, retirement strategies for self-employed Question 1 of 10. Contributions to a SIMPLE...

    federal income tax question, retirement strategies for self-employed Question 1 of 10. Contributions to a SIMPLE IRA are limited to: Employee elective contributions only Employer nonelective contributions only. Employee elective contributions and employer nonelective or matching contributions. Employee elective contributions and employer matching contributions. Mark for follow up Question 2 of 10. Question 3 of 10 A profit-sharing plan is: A defined contribution plan where the employees split the profits A plan where the employer must make discretionary contributions each...

  • Amber's employer, Lavender, Inc., has a § 401(k) plan that permits salary deferral elections by its...

    Amber's employer, Lavender, Inc., has a § 401(k) plan that permits salary deferral elections by its employees. Amber's salary is $99,000, and her marginal tax rate is 24% and she is 42 years old. a. What is the maximum amount Amber can elect for salary deferral treatment for 2019? $ The annual limitations on contributions to and benefits from qualified plans appearing in § 415 must be written into a qualified plan. Section 404 sets the limits on deductibility applicable...

  • Amber's employer, Lavender, Inc., as a § 401(k) plan that permits salary deferral elections by its...

    Amber's employer, Lavender, Inc., as a § 401(k) plan that permits salary deferral elections by its employees. Amber's salary is $99,000, and her marginal tax rate is 24% and she is 42 years old. a. What is the maximum amount Amber can elect for salary deferral treatment for2019? $ x Feedback Check My Work The annual limitations on contributions to and benefits from qualified plans appearing in § 415 must be written into a qualified plan. Section 404 sets the...

  • Amber's employer, Lavender, Inc., as a § 401(k) plan that permits salary deferral elections by its...

    Amber's employer, Lavender, Inc., as a § 401(k) plan that permits salary deferral elections by its employees. Amber's salary is $99,000, and her marginal tax rate is 24% and she is 42 years old. a. What is the maximum amount Amber can elect for salary deferral treatment for2019? $ x Feedback Check My Work The annual limitations on contributions to and benefits from qualified plans appearing in § 415 must be written into a qualified plan. Section 404 sets the...

  • Question 2 - Chapter 5 : Calculate the maximum contribution in 2018 for a 52-year-old employee...

    Question 2 - Chapter 5 : Calculate the maximum contribution in 2018 for a 52-year-old employee earning $140,000 annually, working in a company with the following retirement plans: (1) a 401(k) with no employer match, and (2) a money-purchase plan with an employer contribution equal to 12% of salary:    A. $16,800 B. $18,500 C. $24,500 D. $41,300 E. $55,000 Question 3 - Chapter 5 : Jack and Jill own a successful engineering company, which sponsors a 401(k) plan that...

  • This is Accounting Question. You need to solve the problem. (This question contains content and provides...

    This is Accounting Question. You need to solve the problem. (This question contains content and provides enough information to solve it) 1. Assume a corporate employer maintains a 401(k) profit sharing plan for its 6 employees in 2019. Employer contributions are allocated based on each employee’s compensation which is as follows: Employee Compensation A $500,000 B $120,000 C $80,000 D $60,000 E $50,000 F $40,000 Assume that all employees contribute the maximum amount, including the maximum elective deferral, to the...

  • Today is July 1, 2024. Four years ago, when you started your first job after gradusting...

    Today is July 1, 2024. Four years ago, when you started your first job after gradusting from ohio state in 2020, you began saving s portion of your salary in your company's 401 savings plan. Your salary is $60,000 annually, of which you decide to put 10% in the use annual deposits for simplicity.) Assume the savings plan earns 9% interest annually savings plan at the end of each year. (in reality, a portion is saved from each paycheck, but...

  • 1)Which of the following is an important difference between qualified and nonqualified retirement plans?              a.          Qualified...

    1)Which of the following is an important difference between qualified and nonqualified retirement plans?              a.          Qualified plans provide benefits for retirees who were high-performing employees, while nonqualified plans provide benefits for retirees whose performance did not meet minimum job expectations. b.         Employer contributions are deductible when paid to a qualified plan, but deductible when paid to the employee under a nonqualified plan. c.          Employer contributions to nonqualified plans are subject to dollar limits, but contributions to qualified plans are unlimited. d.         Earnings of...

  • Retirement Planning at J&J Bagel You recently graduated from Suffolk University, and your job search led...

    Retirement Planning at J&J Bagel You recently graduated from Suffolk University, and your job search led you to J&J Bagel, Inc. As you are finishing your employment paperwork, Jerry Chen, one of the co-owners of J&J Bagel, inform you about the company's new 401(k) plan. A 401(k) is a type of retirement plan, offered by many companies. A 401(k) is tax deferred. which means that any deposits you make into the plan are deducted from your current income, so no...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT