I am stuck with adding reset and exit buttons to this. Here is my code.
import java.text.DecimalFormat; import javax.swing.JOptionPane; public class MortgageCalculatorGUI///Name of my File and Class { public static void main(String[] args) { double loanAmount;//Declaring my Variables double loanInterest;//Declaring my Variables double monthlyPayment;//Declaring my Variables double interestRate; int loanTerm; String totalLoan, interestLoan, termLoan; DecimalFormat decimalPlaces=new DecimalFormat("0.00"); //Format decimal point for proper display totalLoan=JOptionPane.showInputDialog(null, "Enter the Loan Amount: "); loanAmount = Double.parseDouble(totalLoan); interestLoan=JOptionPane.showInputDialog(null, "Enter the Interest Rate of the Loan in decimal Form: "); loanInterest = Double.parseDouble(interestLoan)/12; termLoan=JOptionPane.showInputDialog(null, "Enter the Term of the Loan: "); loanTerm = Integer.parseInt(termLoan)*12; // calculations monthlyPayment = loanAmount *(loanInterest/(1 - Math.pow(1 + loanInterest, -loanTerm)));//Formula for Monthly Payments JOptionPane.showMessageDialog(null,"Your Monthly Payments Are" + decimalPlaces.format(monthlyPayment)); System.exit(0);}}.
Can anyone help? It's for my homework assignment due Monday.