import javax.swing.JOptionPane;
import java.text.DecimalFormat;
public class JOptionPaneTest1 {
final static DecimalFormat df = new DecimalFormat("$0.00");
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "Welcome to Morgage Calculator\nVersion 1.0\nPress OK to Continue");
String one;
one = JOptionPane.showInputDialog(null, "Enter Mortgage Amount");
double mrtpymt = Double.parseDouble(one);
String two;
two = JOptionPane.showInputDialog(null, "Enter Interest Rate(examle 5.75 for 5.75%)");
String three;
three = JOptionPane.showInputDialog(null, "Enter Term Limit(in years");
double IntRate = Double.parseDouble(two);
double TrmLimit = Double.parseDouble(three);
double cowtongue = mrtpymt * 41;
double MonthlyMortgagePayment = cowtongue * mrtpymt;
JOptionPane.showMessageDialog(null, "KPH = " + df.format(MonthlyMortgagePayment));
JOptionPane.showConfirmDialog(null,"Would you like to continue?");
}
}

New Topic/Question
Reply




MultiQuote



|