Monthly Payment Program (in the attached photo), update it with the following in java code: If applicable, remove hard coding for the principal, annual interest rate and number of years.  Replace these with Input Dialog Boxes requesting data be entered. The calculation should remain the same. Replace the output area with a showMessage box. Allow the user to request a detailed display of the payment schedule.  This will include the ending balance and interest paid per month in a line-by-line display. Add a loop to the program allowing the user to continue entering new data as many times as they like (all input and output should be displayed in dialog boxes).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Monthly Payment Program (in the attached photo), update it with the following in java code:

  1. If applicable, remove hard coding for the principal, annual interest rate and number of years.  Replace these with Input Dialog Boxes requesting data be entered.

  2. The calculation should remain the same.

  3. Replace the output area with a showMessage box.

  4. Allow the user to request a detailed display of the payment schedule.  This will include the ending balance and interest paid per month in a line-by-line display.

  5. Add a loop to the program allowing the user to continue entering new data as many times as they like (all input and output should be displayed in dialog boxes).

 

public class Lab02bvst
{
public static void main(String[] args)
}
System.out.println("Lab02b, Student Version\n");
double principal = 250000;
double rate = 4.85;
double annualRate = (4.85/100)/12;
double numYears = 30.0;
double time = numYears * 12;
System.out.println("Principal $: " + principal);
System.out.println("Annual Rate:
+ rate + "%");
System.out.println("Number
of years: + numYears);
double p = ((annualRate * Math.pow(1 + annualRate, time) / (Math.pow(1 + annualRate, time) - 1))) * principal;
p = Math.round(p* 100) / 100.0;
//double p = (principal * annualRate) / (1 - Math.pow(1 + annualRate, -time));
System.out.println("Payment: " + p);
double t = time * p;
System.out.println("Total Payments: + t);
double i = t - principal;
System.out.println("Total
Interest: " + i);
Transcribed Image Text:public class Lab02bvst { public static void main(String[] args) } System.out.println("Lab02b, Student Version\n"); double principal = 250000; double rate = 4.85; double annualRate = (4.85/100)/12; double numYears = 30.0; double time = numYears * 12; System.out.println("Principal $: " + principal); System.out.println("Annual Rate: + rate + "%"); System.out.println("Number of years: + numYears); double p = ((annualRate * Math.pow(1 + annualRate, time) / (Math.pow(1 + annualRate, time) - 1))) * principal; p = Math.round(p* 100) / 100.0; //double p = (principal * annualRate) / (1 - Math.pow(1 + annualRate, -time)); System.out.println("Payment: " + p); double t = time * p; System.out.println("Total Payments: + t); double i = t - principal; System.out.println("Total Interest: " + i);
Expert Solution
steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Knowledge Booster
Running Time of Application
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education