Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(6) YO verpayment. (7) The output of Total Amount Paid, Total Interest Paid, and Overpayment must come with a dollar sign $ in front of
(6) YO verpayment. (7) The output of Total Amount Paid, Total Interest Paid, and Overpayment must come with a dollar sign "$" in front of the values. All these values must show only two digits after the decimal point. (8) At last, understand the following statement for Academic Honesty and add it into the top of your source code to submit. The following lines should be added ABOVE the original first line of code. * [CLASS/FILE NAME].java * Author: [YOUR NAME] * Statement of Academic Honesty: * The following code represents my own work. I have neither * received nor given inappropriate assistance. I have not copied * or modified code from anywhere other than the authorized * sources. I recognize that any unauthorized sharing, assistance, * or plagiarism will be handled in accordance with both the * University of Georgia's Academic Honesty Policy and the policies of this course. I recognize that my work is based on *an assignment created by the Department of Computer * Science at the University of Georgia. Any publishing or posting * of source code at any time for this project is prohibited. Replace [CLASS/FILE NAME] with the required name according to the assignment instruction. In this project, it is PayoffDebt. Replace [YOUR NAME] with your actual name. At this time. you do not have to consider invalid inputs by the user. such as negative numbersIntroductlon In this project, you will apply the knowledge of variables, assignments, expressions, type casting, inputi'output, and basic calculation in Java. This project can be done mainly by your using of variable assignment statements as well as input and output statements. sslgnment Write a Java program to compute and display the number of months {integers} needed to pay off a debt, such as a credit card or mortgage. Your program will first prompt the user for the following three variables: [1} principal. This is the amount of money owed on the credit card or the mortgage. [2) onnuol interest rate. This is a fixed value and note that the number Is the yearly rate. [3} monthiy payment. This is the amount that a user plans to pay for the debt each month. Based on these three input values, your program will compute the number of months required to pay the debt. The program will also compute the total amount paid to the lender after all payments are made, the total amount of interest paid, as well as the overpayment'. ' An overpayment happens when the user makes the monthly payment for the last payment month. During the last month. The actual amount of money the user owes can be less than the regular monthly payment. For your reference, the number of months needed to pay off the debt can be calculated using the following formula: n(monthyPa_ymentJ 111(mortthlyPayment W x principal onnuollnterestote I I I In. + 1.!) mix] is the natural logarithm of a real number It > D. You may use this natural base {el logarithm in the Java program to compute. Since we only ta lure the integer as the number of months for debt pay off, the total amount paid to the lender will be the ceiling of the number of months multiplied by the monthly payment. The "ceiling" of a number is the closet integer value no less than such a number. For example, if the program calculates that you need 9.03 months [about 9 months and 1 dayl to pay off the debt, then we will say 1D months will be needed for the entire debt pay off. The total interest paid is the principal amount {provided bv the user} subtracted from the total amount paid to the lender. The overpayment is the amount overpaid to the lender. In this project. irou should figure out how to calculate and get these two values. Take the following example. There are 3 input values, principal [SDDDHDL annual interest rate [1523], and monthlv pavment {lb-Ell respectivelv]. The output of vour program should be formatted in the same was as what it shows below. Principal: Sl} Annual Interest Rate (91:): 151} Monthly Payment: lflfll} Months Needed To Pa},r Off: T9 Total Amount Paid: STQDD Total Interest Paid: SZQDDl} Overpayment: $4.43 Program requirements In order to receive full credit for this project, please follow all these requirements listed below. {I} The name of the program le must be enactlilr PovoebtJovo. As a result, the class name in such a Java source code must also be the sa me. which is Povoebt. {2) The program must read inputs and display the formatted results in the same say as what it shows in the above example. {3) Note that the annual interest rate should be entered as a percent (Le. a value between i] and 10D, not something like sass). {4) The value Months Needed To Pay Off should be handled with with two variables. Dne variable is the raw value {double data tvpel computed bv the formula above. The other variable should be processed and displaved as the output as an integer tvpe, and it should contain the ceiling of such a raw value {the smallest integer greater than or equal to it}. As we previously stated for example. the integer ceiling of are is 1D. {5) All other numeric variables must be double data tvpes
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