Home / Expert Answers / Computer Science / python-problem-problem-for-this-problem-you-will-be-figuring-out-if-it-is-more-beneficial-to-pay-off-pa649

(Solved): python problem Problem For this problem you will be figuring out if it is more beneficial to pay off ...



python problem

Problem
For this problem you will be figuring out if it is more beneficial to pay off your loans first before investing or if
Valid Input
- Loans: A real number greater than or equal to 0
- Loan Annual Interest Rate: A real number greater than or equa
Loans and Investments Walk through
If you are unsure how loans and investment work, please watch this walk through: https://v
Problem For this problem you will be figuring out if it is more beneficial to pay off your loans first before investing or if you should only make the minimum payments and invest the rest. Specifications - Interest rates are given as annual rates (which is how they are normally given) but we will be compounding interest at the beginning of each month (which is also how it is normally done), You will want to use the monthly rates in your calculations - To convert an annual rate to a monthly rate, divide the annual rate by 12 - Interest is applied ot both your loans and your investments at the start of the month. It should be the very first thing you do each month - If after retirement, the user still has loans they will pay them all of from their savings. - This could lead to them having negative savings in retirement which is fine for this problem and would show that the strategy attempted is a bad one Assumptions Input will NOT always be valid - If invalid input is entered you should continually ask the user for input until valid input is entered. - While input may not always be valid it will always be of the correct type. - Ex. If the user should enter an integer they will enter an integer only and won't enter a string or float Valid Input - Loans: A real number greater than or equal to 0 - Loan Annual Interest Rate: A real number greater than or equal to 0 - \( 5 \% \) would be entered as \( 0.05 \) - Loan Minimum Payment: A real number greater than or equal to 0 - Investment Money: A real number greater than or equal to the minimum loan payment - Current Age: An integer greater than or equal to 0 - Retirement Age: An integer greater than or equal to your current age - Investment Annual Returns: A real number greater than or equal to 0 - \( 5 \% \) would be entered as \( 0.05 \) Requirements - There must be a docstring at the top of your program describing what it does - Each function in your program - Must have a doc string describing what it does - Must have its parameters and return value type hinted - Your program must have at least 2 user defined functions Restrictions - No global variables may be used - You may not have any code outside of functions aside from the call to your "main" function and import statements Loans and Investments Walk through If you are unsure how loans and investment work, please watch this walk through: https://video.ucdavis.edu/media/t/1 xvwv94lw Loans and Investments Walk through If you are unsure how loans and investment work, please watch this walk through: https://video.ucdavis.edu/media/t/1_xuwv94lw Hints This problem, while somewhat related to the monthly payment formula that we did in homework 1 , isn't the same and you can't use the formula covered in that problem on this problem. Don't try and look up a closed form solution to this problem. I'm not sure if there is one and the program requires you to use loops, so if you find one you couldn't use it any way. When solving this problem think about what you would do in real life when paying off your loans / savings and have your program do that as well. Since there is a large amount of input you need to enter for the program, don't forget that you can put the input into a file and then redirect the input to your program so you don't have to type it every time. Examples In the examples below user input has been italicized. You don't have to do any italicizing in your program. It is just there to help you differentiate between what is input and what is output. Example 1 Enter how much money you owe in loans: 40000 Enter the annual interest rate of the loans: \( 0.03 \) Enter your minimum monthly loan payment: \( 405.32 \) Enter how much money you will be putting towards loans/retirement each month: 500 Enter your current age: 22 Enter the age you plan to retire at: 65 Enter your predicted annual rate of return: \( 0.05 \) You should only make minimum payments on your loans and invest the rest If you do you will have \( \$ 592888.96 \) as opposed to \( \$ 587281.54 \) when you retire.


We have an Answer from Expert

View Expert Answer

Expert Answer


#include #include #include #include #include //functions void userInput(); bool is_valid_formattin
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe