Question: please write a code for Java. thank you Introduction This project will allow you to apply your knowledge of variables, assignments, expressions, type casting, input,

please write a code for Java. thank you
Introduction This project will allow you to apply your knowledge of variables, assignments, expressions, type casting, input, output, and basic algorithm design. The program can be completed using variable assignment statements as well as input and output statements. You are free, however, to use any other features of Java. You will write a Java application to compute and display the number of months needed to pay off credit card debt. Your program will prompt the user for the following three things: the principal, which is the amount of money owed on the credit card; the annual interest rate; the monthly payment, the amount the user plans to pay the credit card company each month. Based on these inputs, the program will compute the number of months required to pay the debt. It will also compute the total amount paid to the credit card company after all payments are made, the total the amount of interest paid, and the overpayment. The number of months needed to pay off the debt can be calculated using the following formula. annualInterestRate In(monthlyPayment) In (monthlyPayment - 1200.0 x principal) (annualInterestRate In 1200.0 +1.0) In the formula, In(x) is the natural logarithm of a real number x > 0. The total amount paid to the credit card company is the ceiling of the number of months needed to pay off the debt multiplied by the monthly payment. The total interest paid is simply the principal amount (which is provided by the user) subtracted from the total amount paid to the credit card company. The overpayment is the amount overpaid to the credit card company, which is an algorithm you'll have to figure out. Details about these computations are given in the Program Requirements section. The following is a sample run, and the input (5000.00, 15.0, 100.00shown in red for demonstration purposes only) and output of your submitted program should be formatted the same way when run in Eclipse's console or on a command line. Additional sample runs are included at the end of this document. Principal: Annual Interest Rate (%): Monthly Payment: 5000.00 15.0 100.00 Months Needed to Pay Off: Total Amount Paid: Total Interest Paid: Overpayment: 79 $7900.00 $2900.00 $4.43 Hints Aligning the input prompts and the output values will require the use of escape sequences. It is recommended that you use tabs ("\t") rather than spaces. Java's JDK provides a class Math which is always available which contains a method called ceil which will return the ceiling of a given number passed as an argument. The returned value will be returned as a double. For example, double a = Math.ceil(3.4576); double b = Math.ceil (4); // Math.ceil returns 4.00 // Math.ceil returns 4.00 The JDK's Math class also contains a method called log, which returns the natural logarithm, In, of its argument. Again, the returned value has type double. For example, double c = Math.log (12.7); 1/Math.log returns //the In(12.7)*2.54160199
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
