首页 > > 详细

CIS 331 DukeAmort h4

CIS 331 – Spring 2019 Homework #4: DukeAmort Scenario: You have been tasked to write a small Business Finance educational application that will help users understand the benefits of both saving with compound interest and paying off debts early. The program will use a menu interface, and will loop allowing the user to reuse the program as many times as they want until they choose to exit (see example output below). There will be two main menu functions: 1. Savings Table: Your program will allow a user to enter a beginning savings balance, yearly interest rate, and number of years, and it will print a table showing the monthly balances and interest earned. You will just use a formula for simple interest for this task: New Balance = (Old Balance + (Old Balance * Monthly Interest Rate)) You will have to convert the yearly interest rate to a monthly one, and you will need to convert the number of years to number of months. See the output below for an example of how this menu function will work once it runs. 2. Loan Payoff Schedule: Similar to the savings table above, your program will also allow a user to enter a beginning loan balance, yearly interest rate, and the monthly amount paid on the loan. It will then print a table showing how the loan gains interest every month, and how the monthly payment pays off the interest and reduces the principle on the loan: New Monthly Balance = (Old Balance + (Old Balance * Interest)) – Monthly Payment Notice that I do not require the user to enter a number of months or periods of payoff for the loan. Since this program will be an educational tool, your loan payoff table should continue to print months until the balance goes to 0 (See the output below). Additional Requirements:  You will not need Methods, Arrays, or other advanced techniques for this assignment. Focus on topics from Chapters 1 – 5.  Notice the columns (escape characters) and the formatting (.printf()) in the output below. Yours should match this closely, but doesn’t have to match exactly.  Please do your own work on this. I’ve given you all the information and formulas above you will need.  What happens if, on the loan, the monthly payment is less than the monthly interest? You should check for this and prompt the user that their loan will never pay off (see below). Otherwise, print the loan payoff table.  Place a comment header at the top of your .java file. Do not change the name of your .java file once you have exported it. Comment appropriately throughout. Due: Wednesday, February 6th by 11:59 p.m. Worth: 20 Homework Points Example Program Output: Welcome to DukeAmort Please Choose a Menu Option: 1: Savings Table 2: Loan Payoff Schedule 3: Exit Program =================== Choice: 1 =============== Savings: =============== Enter Beginning Amount: 1000 Enter Yearly Interest Rate: 2.5 Enter Number of Years: 2 Savings Amortization: ========================= Period Principal: Interest: Balance: Month #1 $1000.00 $2.08 $1002.08 Month #2 $1002.08 $2.09 $1004.17 Month #3 $1004.17 $2.09 $1006.26 Month #4 $1006.26 $2.10 $1008.36 Month #5 $1008.36 $2.10 $1010.46 Month #6 $1010.46 $2.11 $1012.57 Month #7 $1012.57 $2.11 $1014.67 Month #8 $1014.67 $2.11 $1016.79 Month #9 $1016.79 $2.12 $1018.91 Month #10 $1018.91 $2.12 $1021.03 Month #11 $1021.03 $2.13 $1023.16 Month #12 $1023.16 $2.13 $1025.29 Month #13 $1025.29 $2.14 $1027.42 Month #14 $1027.42 $2.14 $1029.56 Month #15 $1029.56 $2.14 $1031.71 Month #16 $1031.71 $2.15 $1033.86 Month #17 $1033.86 $2.15 $1036.01 Month #18 $1036.01 $2.16 $1038.17 Month #19 $1038.17 $2.16 $1040.33 Month #20 $1040.33 $2.17 $1042.50 Month #21 $1042.50 $2.17 $1044.67 Month #22 $1044.67 $2.18 $1046.85 Month #23 $1046.85 $2.18 $1049.03 Month #24 $1049.03 $2.19 $1051.22 ========================= User enters “1” Everything Formatted and Aligned Properly Please Choose a Menu Option: 1: Savings Table 2: Loan Payoff Schedule 3: Exit Program =================== Choice: 2 =============== Loan Payoff: =============== Enter Beginning Debt: 25000 Enter Yearly Interest Rate: 6.5 Monthly Payment: 100 ===== Your Payment is smaller than your Monthly Interest ===== ===== Loan never pays off! ===== Please try an amount larger than $135.42 Please Choose a Menu Option: 1: Savings Table 2: Loan Payoff Schedule 3: Exit Program =================== Choice: 2 =============== Loan Payoff: =============== Enter Beginning Debt: 25000 Enter Yearly Interest Rate: 6.5 Monthly Payment: 170 Payoff Schedule: ========================= Period Balance: Interest: Payment: Balance: Month #1 $25000.00 $135.42 $170.00 $24965.42 Month #2 $24965.42 $135.23 $170.00 $24930.65 Month #3 $24930.65 $135.04 $170.00 $24895.69 Month #4 $24895.69 $134.85 $170.00 $24860.54 Month #5 $24860.54 $134.66 $170.00 $24825.20 . . . . . . . . . Month #290 $965.13 $5.23 $170.00 $800.35 Month #291 $800.35 $4.34 $170.00 $634.69 Month #292 $634.69 $3.44 $170.00 $468.13 Month #293 $468.13 $2.54 $170.00 $300.66 Month #294 $300.66 $1.63 $170.00 $132.29 Month #295 $132.29 $0.72 $133.01 $0.00 ========================= User enters “2” If they don’t pay more than the interest every month, the loan will never end! Display the first month’s interest here. I have omitted these months to save space in this document, but these omitted months will print in your program Notice that the LAST monthly payment is not $170 but it’s the remaining balance of the loan! Please Choose a Menu Option: 1: Savings Table 2: Loan Payoff Schedule 3: Exit Program =================== Choice: 3 Exiting Program . . . The program should continue allowing the user to make a menu choice as long as they want, until they choose “3” to exit the program.
联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!