Mortgage program

I am working on a Mortgage Calclulator program. I got it to compile and run, but I am not getting the right answer. Any suggestions?
/*MortgageCalculator
by Kelly Ankenbrand
June 25, 2004
Individual Assignment Week 2
//class Mortgage {
class MortgageCalculator {
public static void main(String arguments[]) {
//Program Variables
int LOAN = 200000; // *$200,000 Loan
int TERM = 360; //*360 months
double INTERESTRATE = 5.75; //*5.75% interest rate
double Interest = LOAN * INTERESTRATE;
double Payment = (LOAN + Interest) / TERM;
//Output
System.out.println (" Your monthly payment is $"+ Payment); //*prints monthly payment

Okay,
I reworked my code and got what I needed. I greatly appreciate your help. I have listed my code below but now need to modify the mortgage program to display the mortgage payment amount. Then, list the loan balance and interest paid for each payment over the term of the loan. However I'm not to use a graphical user interface. Now I am really lost. Please help!
//Mortgage.java
public class MortgageCalculator1
public static void main (String[] args){
double payment, principal = 200000;
double annualInterest = .0575;
int years = 30;
if (args.length == 3) {
try {
principal = Double.parseDouble(args[0]);
annualInterest = Double.parseDouble(args[1]);
years = Integer.parseInt(args[2]);
catch (Exception e) {
System.out.println("Wrong input " + e.getMessage() );
System.exit(0);
print(principal, annualInterest, years);
} else {
System.out.println("Usage: java Mortgage principal annualInterest years ");
System.out.println("\nFor example: java Mortgage 200000 .0575 30 ");
System.out.println("\nYou will get the output like the following: \n");
     print(principal, annualInterest, years);
System.exit(0);
public static double calculatePayment(double principal, double annRate, int years){
double monthlyInt = annRate / 12;
double monthlyPayment = (principal * monthlyInt)
/ (1 - Math.pow(1/ (1 + monthlyInt), years * 12));
return format(monthlyPayment, 2);
public static double format(double amount, int places) {
double temp = amount;
temp = temp * Math.pow(10, places);
temp = Math.round(temp);
temp = temp/Math.pow(10, places);
return temp;
public static void print(double pr, double annRate, int years){
double mpayment = calculatePayment(pr, annRate, years);
System.out.println("The principal is $" + (int)pr);
System.out.println("The annual interest rate is " + format(annRate * 100, 2) +"%");
System.out.println("The term is " + years + " years");
System.out.println("Your monthly payment is $" + mpayment);

Similar Messages

  • Mortgage Program in GUI format

    I am having trouble with writing a mortgage program. The program should allow the users to choose the format inwhich they input their mortgage information. It is to then display his mortgage payment, monthly interest, and balance over the duration of the loan. I thought I had everything right, after serveral error corrections, I get the below listed errors. I understand what they are saying is wrong with the program, but I lack the ability ot decipher how to fix it. Any informaton would be greatly appreciated.
    errors:
    H:\My Documents\Java Training\ShellyJava\Chapter.10\week4.java:333: illegal start of expression
    private static void createAndShowGUI() {
    ^
    H:\My Documents\Java Training\ShellyJava\Chapter.10\week4.java:388: ';' expected
    ^
    2 errors
    Code;
    import java.util.Set;
    import java.util.HashSet;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import java.beans.PropertyChangeListener;
    import java.beans.PropertyChangeEvent;
    import java.text.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JFrame;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import java.awt.Container;
    import java.awt.BorderLayout;
    import java.awt.Graphics;
    import java.awt.Graphics.*;
    import java.lang.Math.*;
    import java.util.*;
    import java.text.NumberFormat;
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class week4 extends JPanel {
    //Defines Labels
    private JLabel Amount_Label;
    private JLabel Rate_Label;
    private JLabel Term_Label;
    private JLabel Payments_Label;
    //Defines Strings for Labels
    private static String Amount_String = "Loan Amount: ";
    private static String Rate_String = "Percentage Rate: ";
    private static String Term_String = "Term (In Years): ";
    private static String Payments_String = "Monthly Payment: ";
    //Defines Text Fields
    private JTextField Amount_Field;
    private JTextField Rate_Field;
    private JTextField Term_Field;
    private JTextField Payments_Field;
    //Defines number Formats
    private NumberFormat Loan_Format;
    private NumberFormat Rate_Format;
    private DecimalFormat Term_Format;
    private DecimalFormat Payments_Format;
    private Verifier verifier = new Verifier();
    //Defines Buttons
    private JButton MortgageCalc = new JButton("Calculate");
         private JButton Clear = new JButton("Clear");
         private JButton Exit = new JButton("Good-bye");
         //Defines Combo Boxes
         private JComboBox Rate_Box;
         private JComboBox Term_Box;
    public week4() {
    super(new BorderLayout());
    setUpFormats();
    //Creates the labels.
    Amount_Label = new JLabel(Amount_String);
    Rate_Label = new JLabel(Rate_String);
    Term_Label = new JLabel(Term_String);
    Payments_Label = new JLabel(Payments_String);
    //Creates the text fields
    Amount_Field = new JTextField(Loan_Format.format(0), 12);
    Amount_Field.setInputVerifier(verifier);
    Rate_Field = new JTextField(Rate_Format.format(0), 12);
    Rate_Field.setInputVerifier(verifier);
    Term_Field = new JTextField(Term_Format.format(0), 12);
    Term_Field.setInputVerifier(verifier);
    Payments_Field = new JTextField(Payments_Format.format(0), 12);
    Payments_Field.setInputVerifier(verifier);
    Payments_Field.setEditable(false);
    //Creates Buttons
    MortgageCalc = new JButton("Calculate");
    Clear = new JButton("Clear");
    Exit = new JButton("Exit");
    //Creates the Combo Boxes
    Rate_Box = new JComboBox ();
         Rate_Box.addItem("5.35%");
         Rate_Box.addItem("5.50%");
         Rate_Box.addItem("5.75%");
         Rate_Box.addItem("Select One");
         add(Rate_Box);
    Term_Box = new JComboBox ();
         Term_box.addItem("7 years");
         Term_box.addItem("15 years");
         Term_box.addItem("30 years");
         Term_box.addItem("Select One");
         add(Term_Box);
    //Defines Listner
    Amount_Field.addActionListener(verifier);
    Rate_Field.addActionListener(verifier);
    Term_Field.addActionListener(verifier);
    Rate_Box.addActionListener(verifier);
    Term_box.addActionListener(verifier);
    MortgageCalc.addActionListener(verifier);
    Clear.addActionListner(verifier);
    Exit.addActionListener(verifier);
    //Sets Labels
    Amount_Label.setLabelFor(Amount_Field);
    Rate_Label.setLabelFor(Rate_Box);
    Term_Label.setLabelFor(Term_Box);
    Payments_Label.setLabelFor(Payments_Field);
    //Layout setup
    JPanel labelPane = new JPanel(new GridLayout(0,1));
    labelPane.add(Amount_Label);
    labelPane.add(Rate_Label);
    labelPane.add(Term_Label);
    labelPane.add(Payments_Label);
    JPanel fieldPane = new JPanel(new GridLayout(0,1));
    fieldPane.add(Amount_Field);
    fieldPane.add(Rate_Box);
    fieldPane.add(Term_Box);
    fieldPane.add(Payments_Field);
    JPanel buttonPane = new JPanel();
    buttonPane.setLayout(new FlowLayout(FlowLayout.CENTER));
    buttonPane.add(MortgageCalc);
    buttonPane.add(Clear);
         buttonPane.add(Exit);
    setBorder(BorderFactory.createEmptyBorder(25, 25, 25, 25));
    add(labelPane, BorderLayout.CENTER);
    add(fieldPane, BorderLayout.LINE_END);
    add(buttonPane, BorderLayout.SOUTH);
    class Verifier extends InputVerifier
    implements ActionListener {
    double MIN_AMOUNT = 100;
    double MAX_AMOUNT = 9999999;
    double MIN_RATE = 0.0;
    int MIN_PERIOD = 1;
    int MAX_PERIOD = 30;
    public boolean shouldYieldFocus(JComponent input) {
    boolean inputOK = verify(input);
    updatePayment();
    if (inputOK) {
    return true;
    } else {
    Toolkit.getDefaultToolkit().beep();
    return false;
    protected void updatePayment() {
    double amount = 0;
    double rate = 0.0;
    int termPeriods = 0;
    double payment = 0.0;
    //Parse numbers
    try {
    amount = Loan_Format.parse(Amount_Field.getText()).
    doubleValue();
    } catch (ParseException pe) {}
    try {
    rate = Rate_Format.parse(Rate_Field.getText()).
    doubleValue();
    } catch (ParseException pe) {}
    try {
    termPeriods = Term_Format.parse(Term_Field.getText()).
    intValue();
    } catch (ParseException pe) {}
    //Calculate
    payment = computePayment(amount, rate, termPeriods);
    Payments_Field.setText(Payments_Format.format(payment));
    public boolean verify(JComponent input) {
    return checkField(input, false);
    protected boolean checkField(JComponent input, boolean changeIt) {
    if (input == Amount_Field) {
    return checkAmount_Field(changeIt);
    } else if (input == Rate_Field) {
    return checkRate_Field(changeIt);
    } else if (input == Term_Field) {
    return checkTerm_Field(changeIt);
    } else {
    return true;
    protected boolean checkAmount_Field(boolean change) {
    boolean wasValid = true;
    double amount = 0;
    try {
    amount = Loan_Format.parse(Amount_Field.getText()).
    doubleValue();
    } catch (ParseException pe) {
    wasValid = false;
    if ((amount < MIN_AMOUNT) || (amount > MAX_AMOUNT)) {
    wasValid = false;
    if (change) {
    if (amount < MIN_AMOUNT) {
    amount = MIN_AMOUNT;
    } else {
    amount = MAX_AMOUNT;
    if (change) {
    Amount_Field.setText(Loan_Format.format(amount));
    Amount_Field.selectAll();
    return wasValid;
    protected boolean checkRate_Field(boolean change) {
    boolean wasValid = true;
    double rate = 0;
    try {
    rate = Rate_Format.parse(Rate_Field.getText()).
    doubleValue();
    } catch (ParseException pe) {
    wasValid = false;
    if (rate < MIN_RATE) {
    wasValid = false;
    if (change) {
    rate = MIN_RATE;
    if (change) {
    Rate_Field.setText(Rate_Format.format(rate));
    Rate_Field.selectAll();
    return wasValid;
    protected boolean checkTerm_Field(boolean change) {
    boolean wasValid = true;
    int termPeriods = 0;
    try {
    termPeriods = Term_Format.parse(Term_Field.getText()).
    intValue();
    } catch (ParseException pe) {
    wasValid = false;
    if ((termPeriods < MIN_PERIOD) || (termPeriods > MAX_PERIOD)) {
    wasValid = false;
    if (change) {
    if (termPeriods < MIN_PERIOD) {
    termPeriods = MIN_PERIOD;
    } else {
    termPeriods = MAX_PERIOD;
    if (change) {
    Term_Field.setText(Term_Format.format(termPeriods));
    Term_Field.selectAll();
    return wasValid;
    public void actionPerformed(ActionEvent e) {
    JTextField source = (JTextField)e.getSource();
    shouldYieldFocus(source);
    source.selectAll();
    private static void createAndShowGUI() {
         JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame frame = new JFrame("Week 4 Assignment - Bonnita Ludwig");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JComponent newContentPane = new week4();
    newContentPane.setOpaque(true);
    frame.setContentPane(newContentPane);
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    double computePayment(double loanAmt, double rate, int termPeriods) {
    double I, partial1, denominator, answer;
    termPeriods *= 12;
    if (rate > 0.01) {
    I = rate / 100.0 / 12.0;
    partial1 = Math.pow((1 + I), (0.0 - termPeriods));
    denominator = (1 - partial1) / I;
    } else {
    denominator = termPeriods;
    answer = (-1 * loanAmt) / denominator;
    return answer;
    private void setUpFormats() {
    Loan_Format = (NumberFormat)NumberFormat.getNumberInstance();
    Rate_Format = NumberFormat.getNumberInstance();
    Rate_Format.setMinimumFractionDigits(3);
    Term_Format = (DecimalFormat)NumberFormat.getNumberInstance();
    Term_Format.setParseIntegerOnly(true);
    Payments_Format = (DecimalFormat)NumberFormat.getNumberInstance();
    Payments_Format.setMaximumFractionDigits(2);
    Payments_Format.setNegativePrefix("(");
    Payments_Format.setNegativeSuffix(")");
    /* References:
    *http://java.sun.com/docs/books/tutorial/uiswing/misc/example-1dot4/index.html#InputVerificationDemo
    *http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html
    */

    Thanks for the direction, but I am still getting this error:
    week4.java:377: illegal start of expression
    public actionPerformed(ActionEvent e)
    ^
    1 error
    I see that I have to work on my ability to decipher code. I am very new Java and really appreciate your assistance. I have included my code after making the several changes.
    Code:
    import java.util.Set;
    import java.util.HashSet;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import java.beans.PropertyChangeListener;
    import java.beans.PropertyChangeEvent;
    import java.text.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JFrame;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import java.awt.Container;
    import java.awt.BorderLayout;
    import java.awt.Graphics;
    import java.awt.Graphics.*;
    import java.lang.Math.*;
    import java.util.*;
    import java.text.NumberFormat;
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class week4 extends JPanel
    //Defines Labels
    private JLabel Amount_Label;
    private JLabel Rate_Label;
    private JLabel Term_Label;
    private JLabel Payments_Label;
    //Defines Strings for Labels
    private static String Amount_String = "Loan Amount: ";
    private static String Rate_String = "Percentage Rate: ";
    private static String Term_String = "Term (In Years): ";
    private static String Payments_String = "Monthly Payment: ";
    //Defines Text Fields
    private JTextField Amount_Field;
    private JTextField Rate_Field;
    private JTextField Term_Field;
    private JTextField Payments_Field;
    //Defines number Formats
    private NumberFormat Loan_Format;
    private NumberFormat Rate_Format;
    private DecimalFormat Term_Format;
    private DecimalFormat Payments_Format;
    private Verifier verifier = new Verifier();
    //Defines Buttons
    private JButton MortgageCalc = new JButton("Calculate");
         private JButton Clear = new JButton("Clear");
         private JButton Exit = new JButton("Good-bye");
         //Defines Combo Boxes
         private JComboBox Rate_Box;
         private JComboBox Term_Box;
    public week4()
    super(new BorderLayout());
    setUpFormats();
    //Creates the labels.
    Amount_Label = new JLabel(Amount_String);
    Rate_Label = new JLabel(Rate_String);
    Term_Label = new JLabel(Term_String);
    Payments_Label = new JLabel(Payments_String);
    //Creates the text fields
    Amount_Field = new JTextField(Loan_Format.format(0), 12);
    Amount_Field.setInputVerifier(verifier);
    Rate_Field = new JTextField(Rate_Format.format(0), 12);
    Rate_Field.setInputVerifier(verifier);
    Term_Field = new JTextField(Term_Format.format(0), 12);
    Term_Field.setInputVerifier(verifier);
    Payments_Field = new JTextField(Payments_Format.format(0), 12);
    Payments_Field.setInputVerifier(verifier);
    Payments_Field.setEditable(false);
    //Creates Buttons
    MortgageCalc = new JButton("Calculate");
    Clear = new JButton("Clear");
    Exit = new JButton("Exit");
    //Creates the Combo Boxes
    Rate_Box = new JComboBox ();
         Rate_Box.addItem("5.35%");
         Rate_Box.addItem("5.50%");
         Rate_Box.addItem("5.75%");
         Rate_Box.addItem("Select One");
         add(Rate_Box);
    Term_Box = new JComboBox ();
         Term_box.addItem("7 years");
         Term_box.addItem("15 years");
         Term_box.addItem("30 years");
         Term_box.addItem("Select One");
         add(Term_Box);
    //Defines Listner
    Amount_Field.addActionListener(verifier);
    Rate_Field.addActionListener(verifier);
    Term_Field.addActionListener(verifier);
    Rate_Box.addActionListener(verifier);
    Term_box.addActionListener(verifier);
    MortgageCalc.addActionListener(verifier);
    Clear.addActionListner(verifier);
    Exit.addActionListener(verifier);
    //Sets Labels
    Amount_Label.setLabelFor(Amount_Field);
    Rate_Label.setLabelFor(Rate_Box);
    Term_Label.setLabelFor(Term_Box);
    Payments_Label.setLabelFor(Payments_Field);
    //Layout setup
    JPanel labelPane = new JPanel(new GridLayout(0,1));
    labelPane.add(Amount_Label);
    labelPane.add(Rate_Label);
    labelPane.add(Term_Label);
    labelPane.add(Payments_Label);
    JPanel fieldPane = new JPanel(new GridLayout(0,1));
    fieldPane.add(Amount_Field);
    fieldPane.add(Rate_Box);
    fieldPane.add(Term_Box);
    fieldPane.add(Payments_Field);
    JPanel buttonPane = new JPanel();
    buttonPane.setLayout(new FlowLayout(FlowLayout.CENTER));
    buttonPane.add(MortgageCalc);
    buttonPane.add(Clear);
         buttonPane.add(Exit);
    setBorder(BorderFactory.createEmptyBorder(25, 25, 25, 25));
    add(labelPane, BorderLayout.CENTER);
    add(fieldPane, BorderLayout.LINE_END);
    add(buttonPane, BorderLayout.SOUTH);
         class Verifier extends InputVerifier implements ActionListener
         double MIN_AMOUNT = 100;
         double MAX_AMOUNT = 9999999;
         double MIN_RATE = 0.0;
         int MIN_PERIOD = 1;
         int MAX_PERIOD = 30;
              public boolean shouldYieldFocus(JComponent input)
         boolean inputOK = verify(input);
         updatePayment();
         if (inputOK)
         return true;
         else
         Toolkit.getDefaultToolkit().beep();
         return false;
         protected void updatePayment()
         double amount = 0;
         double rate = 0.0;
         int termPeriods = 0;
         double payment = 0.0;
         //Parse numbers
         try
         amount = Loan_Format.parse(Amount_Field.getText()).
    doubleValue();
         catch (ParseException pe)
         try
    rate = Rate_Format.parse(Rate_Field.getText()).
    doubleValue();
         catch (ParseException pe)
         try
    termPeriods = Term_Format.parse(Term_Field.getText()).
    intValue();
         catch (ParseException pe)
         //Calculate
         payment = computePayment(amount, rate, termPeriods);
         Payments_Field.setText(Payments_Format.format(payment));
    public boolean verify(JComponent input)
    return checkField(input, false);
    protected boolean checkField(JComponent input, boolean changeIt)
    if (input == Amount_Field)
    return checkAmount_Field(changeIt);
    else if (input == Rate_Field)
    return checkRate_Field(changeIt);
    else if (input == Term_Field)
    return checkTerm_Field(changeIt);
    else
    return true;
    protected boolean checkAmount_Field(boolean change)
    boolean wasValid = true;
    double amount = 0;
    try
    amount = Loan_Format.parse(Amount_Field.getText()).
    doubleValue();
    catch (ParseException pe)
    wasValid = false;
    if ((amount < MIN_AMOUNT) || (amount > MAX_AMOUNT))
    wasValid = false;
    if (change)
    if (amount < MIN_AMOUNT)
    amount = MIN_AMOUNT;
    else
    amount = MAX_AMOUNT;
    if (change)
    Amount_Field.setText(Loan_Format.format(amount));
    Amount_Field.selectAll();
    return wasValid;
    protected boolean checkRate_Field(boolean change)
    boolean wasValid = true;
    double rate = 0;
    try
    rate = Rate_Format.parse(Rate_Field.getText()).
    doubleValue();
    catch (ParseException pe)
    wasValid = false;
    if (rate < MIN_RATE)
    wasValid = false;
    if (change)
    rate = MIN_RATE;
    if (change)
    Rate_Field.setText(Rate_Format.format(rate));
    Rate_Field.selectAll();
    return wasValid;
    protected boolean checkTerm_Field(boolean change)
    boolean wasValid = true;
    int termPeriods = 0;
    try
    termPeriods = Term_Format.parse(Term_Field.getText()).
    intValue();
    catch (ParseException pe)
    wasValid = false;
    if ((termPeriods < MIN_PERIOD) || (termPeriods > MAX_PERIOD))
    wasValid = false;
    if (change)
    if (termPeriods < MIN_PERIOD)
    termPeriods = MIN_PERIOD;
    else
    termPeriods = MAX_PERIOD;
    if (change)
    Term_Field.setText(Term_Format.format(termPeriods));
    Term_Field.selectAll();
    return wasValid;
    public actionPerformed(ActionEvent e)
    JTextField source = (JTextField)e.getSource();
    shouldYieldFocus(source);
    source.selectAll();
         public createAndShowGUI()
              JFrame.setDefaultLookAndFeelDecorated(true);
         JFrame frame = new JFrame("Week 4 Assignment - Bonnita Ludwig");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         JComponent newContentPane = new week4();
         newContentPane.setOpaque(true);
         frame.setContentPane(newContentPane);
         frame.pack();
         frame.setVisible(true);
         public static void main(String[] args)
         javax.swing.SwingUtilities.invokeLater(new Runnable()
         public void run()
         createAndShowGUI();
         double computePayment(double loanAmt, double rate, int termPeriods)
         double I, partial1, denominator, answer;
         termPeriods *= 12;
         if (rate > 0.01)
         I = rate / 100.0 / 12.0;
         partial1 = Math.pow((1 + I), (0.0 - termPeriods));
         denominator = (1 - partial1) / I;
         else
         denominator = termPeriods;
         answer = (-1 * loanAmt) / denominator;
              return answer;
         private void setUpFormats()
         Loan_Format = (NumberFormat)NumberFormat.getNumberInstance();
         Rate_Format = NumberFormat.getNumberInstance();
         Rate_Format.setMinimumFractionDigits(3);
         Term_Format = (DecimalFormat)NumberFormat.getNumberInstance();
         Term_Format.setParseIntegerOnly(true);
         Payments_Format = (DecimalFormat)NumberFormat.getNumberInstance();
         Payments_Format.setMaximumFractionDigits(2);
         Payments_Format.setNegativePrefix("(");
         Payments_Format.setNegativeSuffix(")");
    }

  • Need help with total in my mortgage program

    I have been work on this program and I can't seem to correct how the amount is shown. It gives several numbers after the decimal. Can anyone please help.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    /* Diana Saddler
    * PRG-421  Java Programming II
    public class mortgage extends JFrame implements ActionListener {
    private JPanel panelAdder;
    private JLabel labela;
    private JLabel labelt;
    private JLabel labelr;
    private JTextField textFieldAmount;
    private JTextField textFieldTerm;
    private JTextField textFieldRate;
    private JTextField textFieldResult;
    private JButton buttonCalc;
    public mortgage() {
      initComponents();
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setVisible(true);
      pack();
      // Add Listeners
      buttonCalc.addActionListener(this);
    public void initComponents() {
    //Initialize Components
    panelAdder = new JPanel();
    labela = new JLabel("Amount");
    textFieldAmount = new JTextField();
    labelt = new JLabel("Term");
    textFieldTerm = new JTextField();
    labelr = new JLabel("Rate");
    textFieldRate = new JTextField();
    textFieldResult = new JTextField();
    buttonCalc = new JButton("Calculate");
    //Set Object Attributes
    textFieldResult.setEditable(false);
    textFieldResult.setColumns(8);
    textFieldAmount.setColumns(6);
    textFieldTerm.setColumns(3);
    textFieldRate.setColumns(3);
    Container contentPane = getContentPane();
    contentPane.setLayout(new FlowLayout());
    //Add the components to the panel
    panelAdder.add(labela);
    panelAdder.add(textFieldAmount);
    panelAdder.add(labelt);
    panelAdder.add(textFieldTerm);
    panelAdder.add(labelr);
    panelAdder.add(textFieldRate);
    panelAdder.add(buttonCalc);
    panelAdder.add(textFieldResult);
    contentPane.add(panelAdder);
        public static void main(String[] args) {
             mortgage frame = new mortgage();
    //calculate
        private void setResultValue() {
       double amount = Double.parseDouble(textFieldAmount.getText());
       double term = Integer.parseInt(textFieldTerm.getText());
       double rate = Double.parseDouble(textFieldRate.getText()) / 100.;
       double result = amount * ( rate * Math.pow ( ( 1 + rate ), term ) ) / ( Math.pow( ( 1 + rate ), term ) - 1 );
       textFieldResult.setText(Double.toString(result));
    public void actionPerformed(ActionEvent event) {
      System.out.println("Action Button");
      String command = event.getActionCommand();
      if ("Calculate".equals(command))
          setResultValue();
    }

    DecimalFormat

  • Mortgage Program Question

    Hello all, I am having issues with my program, I did ask a question before apparently I was told that I was not cleared, so I'm going to try to explain my problem the best that I can. I have to create a mortgage calculator with GUI that would allow user's to input a Loan amount, select from the menu. What I'm confused is that when I input an amount and select, from the menu then press the calculate button, the monthly payment and the values in my textarea is giving me a worng answer. It looks to me that the formula is calculating my term array values as the rate, and my rate array as the term, and it's giving a huge amount of payment. Can anyone hint me on waht I'm doing wrong, with my loop, and why its calculating like that.
    private void calculateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_calculateButtonActionPerformed
    // Number Format
    NumberFormat currency = NumberFormat.getCurrencyInstance();
    // Defined Variable
    double loanAmt = 0;
    double rate = 0;
    double term = 0;
    double monthlyPmt = 0;
    double rateArray [] = {7, 15, 30}; //declaration for rate array
    double termArray [] = {5.35, 5.50, 5.75}; //declaration for term array
    int k [] = new int [3];
    int m;
    /*Calculation formulas and parse user's input on Loan amount and
    user's chooses on Loan rate and term. */
    int a = menu.getSelectedIndex();
    term = termArray[a];
    rate = rateArray[a];
    for (int b = 0; b<k.length; b++);{
    if (a <= 2) {
    try {
    loanAmt = Double.parseDouble(amountField.getText());
    term = termArray[a];
    rate = rateArray[a];
    catch (NumberFormatException e) {
    if (loanAmt > 0) {
    loanAmt = Double.parseDouble(amountField.getText());//get the user's choosen item and parse it to the formula
    double mRate = rate / 12; //Calculate monthly rate;
    double months = term * 12; //calculate how many months in the loan term
    monthlyPmt = (loanAmt * (mRate / (1 - Math.pow((1 + mRate), - months)))); //Formula for Monthly Payment
    //Transfer the calculation result to the Monthly Payment text field
    paymentField.setText(String.valueOf(currency.format(monthlyPmt)));
    //Transfer the amortization result to the Table Text Area
    tableTextArea.append("Payment #");
    tableTextArea.append("\t");
    tableTextArea.append("Monthly Pmt");
    tableTextArea.append("\t ");
    tableTextArea.append("Int Paid");
    tableTextArea.append("\t");
    tableTextArea.append("Principal");
    tableTextArea.append("\t ");
    tableTextArea.append("Balance");
    tableTextArea.append("\t\n");
    double balance = loanAmt;
    for (m = 1; m <= months; m++) {
    double intPmt = balance * mRate; //Calculate the Interest paid
    double prin = monthlyPmt - intPmt;
    balance = balance - prin; // Calculate the Loan Balance
    tableTextArea.append(" \n" + m);
    tableTextArea.append("\t" + currency.format(monthlyPmt));
    tableTextArea.append("\t " + currency.format(intPmt));
    tableTextArea.append("\t" + currency.format(prin));
    tableTextArea.append("\t " + currency.format(balance));
    }//GEN-LAST:event_calculateButtonActionPerformed

    OMG thank you thank you. I have been looking at this for long and i guess i needed someone else's opinion to see my mistake. Also when I checked out what you said, I also notice that I named my array wrong. it should be the arrays i have of {7, 25, 30} is my term, and I have it mark as my rate... lol so stupid of me. But thanks a lot :) I really appreciate it/

  • Need Java Help on a Mortgage program

    I keep getting the following error.
    java:20: illegal start of expression
    public Scanner myScanner = new Scanner(System.in);
    /*Danielle Safonte*/
    /* Week 2 Mortgage Calculator*/
    import java.util.Scanner;
    import java.io.*;
    import java.text.*;
    public class Week2Assignment
    int principle = 200000;
    float interest = .0575;
    int term = 30;
    int months;
    float paymentdue;
    float calculation;
    public static void months()
    public Scanner myScanner = new Scanner(System.in);
    System.out.print("What month of the loan is this?" + months);
    if (months = term) {
    System.out.print("You have paid off your loan");
    else
         months = myScanner.next();
         float Jinterest = (interest / (months*100));
         calculation = principle * (Jinterest/(1-(1+Jinterest)^(-months))); /*Monthly payment*/
         float Minterest = principle * Jinterest; /*This months interest*/
         float Mprinciple = calculation - Minterest; /*This months principle*/
         float newBalance = principle - Mprinciple; /*This calculates the new principle*/
         if (newBalance = princple) {
              System.out.print("You have paid off your loan");
         else
              System.out.print("This months payment is: $", calculation); /*Displays the current months payment*/
              System.out.print("You have $", newBalance," left on your loan"); /*Displays the new principle balance*/
              System.out.print("This months principle is: $", Mprinciple ); /*Displays the new principle balance*/
    }

    It is in my post at 10:02, but here it is again:
    These are the errors that I am left with. I worked through the rest.
    .java:29: '.class' expected
    months = myScanner.next(int);
    ^
    .java:29: ')' expected
    months = myScanner.next(int);
    ^
    2 errors
    Tool completed with exit code 1
    import java.util.Scanner;
    import java.io.*;
    import java.text.*;
    public class Week2Assignment
    int principle = 200000;
    double  interest = .0575;
    int term = 30;
    int months;
    float paymentdue;
    float calculation;
    public void months()
    Scanner myScanner = new Scanner(System.in);
       System.out.print("What month of the loan is this?" + months);
    if (months == term) {
       System.out.print("You have paid off your loan");
    else
         months = myScanner.next(int);
         double Jinterest = (interest / (months*100));
         calculation = principle * (Jinterest/(1-(1+Jinterest)^(-months))); /*Monthly payment*/
         float Minterest = principle * Jinterest; /*This months interest*/
         float Mprinciple = calculation - Minterest; /*This months principle*/
         float newBalance = principle - Mprinciple; /*This calculates the new principle*/
         if (newBalance == princple) {
                 System.out.print("You have paid off your loan");
         else
                 System.out.print("This months payment is: $", calculation); /*Displays the current months payment*/
                 System.out.print("You have $", newBalance," left on your loan"); /*Displays the new principle balance*/
                 System.out.print("This months principle is: $", Mprinciple ); /*Displays the new principle balance*/
    }

  • Need help with adding the following to a program

    Modify the mortgage program to display the mortgage payment amount. Then, list the loan balance and interest paid for each payment over the term of the loan. The list would scroll off the screen, but use loops to display a partial list, hesitate, and then display more of the list. Do not use a graphical user interface. Insert comments in the program to document the program.
    Currently I am working on adding the following line in bold but getting error expected ";" on line 27
    import java.io.*;
    import java.util.Date;
    import java.text.DecimalFormat;
    public class Mortgage5
    public static void main(String[] args)
    Date currentDate = new Date(); //Date constructor
    DecimalFormat decimalPlaces = new DecimalFormat("$###,###.##");
    //declaring variables
    final double PRINCIPLE = 200000;
    final double INTEREST = .0575/12;
    final double TERM = 12*30;
    //declaring variables
    final double MONTHLY =PRINCIPLE*(INTEREST/(1-Math.pow(1+INTEREST, -TERM)));
    //displaying variables
    System.out.println("\t\t" + currentDate);
    System.out.println("\t\tPrinciple or Loan Amount: " + decimalPlaces.format(PRINCIPLE));
    System.out.println("\t\tInterest Rate: " + (INTEREST));
    System.out.println("\t\tThe Term of Loan (in months): " + (TERM));
    System.out.println("\t\tThe Monthly Payment is: " + decimalPlaces.format(MONTHLY));
    System.out.println("\t\tThe Balence - Your Payment is: " + decimalPlaces.format(PRINCIPLE*INTEREST*TERM)-MONTHLY));
    Any suggestions??? PLEASE

    Ok I figured out the issue now if someone can help me. I need to create a loop for the following:
    The list would scroll off the screen, but use loops to display a partial list, hesitate, and then display more of the list.
    Here is the Program so far.
    import java.io.*;
    import java.util.Date;
    import java.text.DecimalFormat;
    public class Mortgage5
    public static void main(String[] args)
    Date currentDate = new Date(); //Date constructor
    DecimalFormat decimalPlaces = new DecimalFormat("$###,###.##");
    //declaring variables
    final double PRINCIPLE = 200000;
    final double INTEREST = .0575/12;
    final double TERM = 12*30;
    //declaring variables
    final double MONTHLY =PRINCIPLE*(INTEREST/(1-Math.pow(1+INTEREST, -TERM)));
    final double NEWBAL = (PRINCIPLE*INTEREST*TERM) -MONTHLY;
    //displaying variables
    System.out.println("\t\t" + currentDate);
    System.out.println("\t\tPrinciple or Loan Amount: " + decimalPlaces.format(PRINCIPLE));
    System.out.println("\t\tInterest Rate: " + (INTEREST));
    System.out.println("\t\tThe Term of Loan (in months): " + (TERM));
    System.out.println("\t\tThe Monthly Payment is: " + decimalPlaces.format(MONTHLY));
    System.out.println("\t\tThe Balence - Your Payment is: " + decimalPlaces.format(NEWBAL));
    }

  • 2 Problems w/ 2 Programs

    // Mortgage Program w/ graphical interface & set year and rate inputs
    // By : 2/05
    import javax.swing.*;
    import java.awt.*;
    public class MortgageGui2 extends JFrame {
    MortgageGui2Support mortgageSupport = new MortgageGui2Support(this);
    // Row 1
    JPanel row1 = new JPanel();
    JLabel Amount = new JLabel("Amount $", JLabel.LEFT);
    JTextField txtAmount = new JTextField(10);
    JLabel Selection = new JLabel("Select Term/Rate", JLabel.LEFT);
    JLabel Payment = new JLabel ("Monthly Payment is:");
    JTextField paymentValueBox = new JTextField (10);
    JComboBox comboTermInterest = new JComboBox();
    // Row2
    JPanel row2 = new JPanel();
    JLabel Month = new JLabel("\nPayment", JLabel.LEFT);
    JLabel IntBalance = new JLabel("Interest Paid", JLabel.CENTER);
    JLabel Remaining = new JLabel("Balance", JLabel.RIGHT);
    // Row 3
    JPanel row3 = new JPanel();
    JTextArea txtResults = new JTextArea(10, 35);
    // Row 4
    JPanel row4 = new JPanel();
    JButton calculateButton = new JButton("Calculate");
    JButton clearButton = new JButton("Reset");
    JButton exitButton = new JButton("Exit");
    public MortgageGui2() {
         super("Mortgage Calculator Week 2");
         setSize(655, 350);
         setLocation(250, 60);
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         FlowLayout layout = new FlowLayout();
         Container pane = getContentPane();
         pane.setLayout(layout);
         // Buttons
         calculateButton.addActionListener(mortgageSupport);
         clearButton.addActionListener(mortgageSupport);
         comboTermInterest.addItemListener(mortgageSupport);
         exitButton.addActionListener(mortgageSupport);
         // Row 1
         FlowLayout flow1 = new FlowLayout();
         row1.setLayout(flow1);
         row1.add(Amount);
         row1.add(txtAmount);
         row1.add(Selection);
         row1.add(comboTermInterest);
         comboTermInterest.setEnabled(true);
         comboTermInterest.addItem(" Choose One ");
         comboTermInterest.addItem("7 years at 5.35% ");
         comboTermInterest.addItem("15 years at 5.5% ");
         comboTermInterest.addItem("30 years at 5.75% ");
         row1.add (Payment);
         row1.add (paymentValueBox);
         pane.add(row1);
         // Row 2
         GridLayout flow2 = new GridLayout(1, 4, 5, 1);
         row2.setLayout(flow2);
         row2.add(Month);
         row2.add(IntBalance);
         row2.add(Remaining);
         pane.add(row2);
         // Row 3
         txtResults.setLineWrap(true);
         JScrollPane textPane = new JScrollPane(txtResults,
              JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
              JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
         row3.add(textPane);
         pane.add(row3);
         // Row 4
         GridLayout flow5 = new GridLayout (1,5,85,1);
         row4.setLayout(flow5);
         row4.add(calculateButton);
         calculateButton.setEnabled(false);
         row4.add(clearButton);
         clearButton.setEnabled(false);
         row4.add(exitButton);
         pane.add(row4);
    public static void main(String[] args) {
         MortgageGui2 guiFrame = new MortgageGui2();
         guiFrame.setVisible(true);
    // Support section of program.
    import java.text.NumberFormat;
    import java.awt.event.*;
    import java.math.*;
    public class MortgageGui2Support implements ItemListener, ActionListener {
         MortgageGui2 gui;
         int array;
         double [] arrayMonths = {0,84,180,360};
         int c = 1;
         double [] arrayInterest = {0,5.35,5.5,5.75};
         int i = 1;
              public MortgageGui2Support (MortgageGui2 in) {
                   gui = in;
    public static void main(String[] arguments) {
    public void itemStateChanged(ItemEvent arg0) {
         Object button = gui.comboTermInterest.getSelectedItem();
         String buttonPress = button.toString();
              if (buttonPress == "7 years at 5.35% ") {
                   array = 1;
                   gui.calculateButton.setEnabled(true);
                   gui.clearButton.setEnabled(true);
              if (buttonPress == "15 years at 5.5% ") {
                   array = 2;
                   gui.calculateButton.setEnabled(true);
                   gui.clearButton.setEnabled(true);
              if (buttonPress == "30 years at 5.75% ") {
                   array = 3;
                   gui.calculateButton.setEnabled(true);
                   gui.clearButton.setEnabled(true);
    public void actionPerformed(ActionEvent event) {
         String buttonClicked = event.getActionCommand();
              if (buttonClicked == "Calculate") {
                   clearResults();
                   funcCalculate();
              if (buttonClicked == "Reset")
                   setNull();
              if (buttonClicked == "Exit")
                   System.exit(0);
         void funcCalculate()     {
              do {
                   NumberFormat fmt = NumberFormat.getInstance();
                   fmt.setGroupingUsed (true);
                   fmt.setMaximumFractionDigits(2);
                   fmt.setMinimumFractionDigits(2);
                   String txtInitialAmount = gui.txtAmount.getText();
                   gui.comboTermInterest.setEnabled(true);
                   gui.calculateButton.setEnabled(true);
                   // Calculations
                   double initBalance = Double.parseDouble(txtInitialAmount);
                   double loanRateMonth = (arrayInterest[array] / 1200);
                   for(int i = 1; i <= arrayMonths[array]; i++) {
                        double monthInterest = arrayInterest[array] / (1200);
                        double monthPayment = (initBalance *( loanRateMonth) / (1 -(1/ Math.pow((1 + loanRateMonth),( arrayMonths[array])))));
                        double Interest = (initBalance * monthInterest);
                        double totalamount = (Interest + initBalance);
                        double remaining = (totalamount - monthPayment);
                        initBalance = (totalamount - monthPayment);
                        // Output
                        gui.txtResults.append("\t " + i + "\t$"
                             + fmt.format (Interest) + "\t$"
                             + fmt.format (remaining) + "\t\n");
                             c++;
              } while (c <= arrayMonths[array]);
         void setNull() {
              gui.txtAmount.setText (null);
              gui.comboTermInterest.setSelectedItem("Select Option");
              gui.txtResults.setText(null);
              i = 1;
         void clearResults() {
              gui.txtResults.setText(null);
    These two programs work together and I am getting the wrong balance in the output and I need to know how to input the monthly mortgage output to the box at the end of line 1. Thanks

    I didn't go thru all of it, but these things are common mistakes:
    if (buttonPress == "7 years at 5.35% ")Always use the String.equals method to compare, not the == operator, which only compares object references, not values.
    You really should only post specific questions, not whole progs with the "question" basically "please fix it for me".

  • Mortgage Calculator in Java

    Can anyone help me figure out how to change my mortgage calculator to do the following?
    Modify the mortgage program to display the mortgage payment amount. Then, list the loan balance and interest paid for each payment over the term of the loan. The list would scroll off the screen, but use loops to display a partial list, hesitate, and then display more of the list. Do not use a graphical user interface. Insert comments in the program to document the program. Here is the code I have currently.
    import java.io.*;
    import java.text.DecimalFormat;
    public class MortgageRateWeek3Test
         public static void main(String[] args) throws IOException
              //Declaring and Constructing Variables
              int iTerm;
              double dInterest = 5.75;
              double dPayment, dRate, dAmount = 200000, dMonthlyInterest,dMonthlyPrincipal, dMonthlyBalance;
              DecimalFormat twoDigits = new DecimalFormat("$#,000.00");
                        //Calculations Retrieved from http://www.1728.com/loanform.htm on 9/14/05
                        dRate = dInterest / 1200;
                        iTerm = 360;
                        dPayment = (dAmount * dRate) / (1 - Math.pow(1 / (1 + dRate), iTerm));
                        dMonthlyInterest = (dAmount / 12) * (dInterest / 100);
                        dMonthlyPrincipal = (dPayment - dMonthlyInterest);
                        dMonthlyBalance = (dAmount - dMonthlyPrincipal);
                                  // Output dPayment
                                  System.out.println();
                                  System.out.println("\tYour Monthly Payment is: " + twoDigits.format (dPayment));
                                  System.out.println();
         public class monthlyInterest
              //Declaring Variables for monthlyInterest
              double dMonthlyInterest = 0.0;
              double dAmount = 0.0;
              double dInterest = 0.0;
                   //Calculations for monthlyInterest
                   dMonthlyInterest = (dAmount / 12) * (dInterest / 100);
              return dMonthlyInterest;
         public static double monthlyPrincipal()
              //Declaring Variables for monthlyPrincipal
              double dMonthlyPrincipal = 0.0;
              double dPayment = 0.0;
              double dMonthlyInterest = 0.0;
                   //Calculations for monthlyPrincipal
                   dMonthlyPrincipal = (dPayment - dMonthlyInterest);
              return dMonthlyPrincipal;
         public static double monthlyBalance()
              //Declaring Variables for monthlyBalance
              double dMonthlyBalance = 0.0;
              double dAmount = 0.0;
              double dMonthlyPrincipal = 0.0;
                   //Calculations for monthlyBalance
                   dMonthlyBalance = (dAmount - dMonthlyPrincipal);
              return dMonthlyBalance;
    }

    There are imports that aren't available to us, so no. nobody probaly can. Of course maybe someon could be bothered going through all of your code, and may spot some mistake. But I doubt they will since you didn't bother to use [c[b]ode] tags.

  • Mortgage code

    I know that this has been discussed before but I new to Java and would appreciate any help. This is my task:
    1.) Modify the mortgage program to prompt a user to enter the principal amount, interest rate and number of years. (Example when you run the program the application must prompt the user like: Please enter the principal amount: ) (Hint: use System.in.read () to get the user input).
    2.)Display the mortgage monthly payment amount for the loan and then list the loan balance and interest paid for each payment over the term of the loan (amortization schedule).
    3.)The list would scroll off the screen, but use loops to display a partial list, hesitate, and then display more of the list.
    Do not use a graphical user interface.
    Update the version control information and provide appropriate comments in the program.
    I have the code prompting the user for the input but cannot get the calculations to work. I have the calculations working from another assignment but don't know how to incorporate the two together.
    Here is the code prompting the user:
    filename: W5help
    import java.text.DecimalFormat;
    import java.io.;
    import java.text.*;
    import java.util.Locale;
    public class W5help
    private static BufferedReader stdin = new BufferedReader(new InputStreamReader (System.in));
    public static void main(String[] args) throws IOException
    //local objects
    W5help mortgageCalc = new W5help();
    DecimalFormat df = new DecimalFormat("###,##0.00"); // to format the amount.
    DecimalFormat numDf = new DecimalFormat("000"); // to format the sequence number.
    //local variable
    double principal = 0;
    double annualInterest = 0;
    int numOfYears = 0;
    double monthlyInterest = annualInterest/(12*100);
    int totalNumOfMonths = numOfYears*12;
    //Promput user to enter Principal Amount
    System.out.println();
    System.out.println("Welcome to the mortgage payment calculator");
    System.out.println();
    System.out.println("Enter the Principal Amount: ");
    String input = stdin.readLine();
    principal = Double.parseDouble(input); //get the double value from the input
    // Prompt user to enter Loan Amount
    System.out.println();
    System.out.println("Enter the Interest Rate: ");
    String input2 = stdin.readLine();
    annualInterest = Double.parseDouble(input2); //get the double value from input 2
    //Prompt user to enter Number of Years
    System.out.println();
    System.out.println("Enter Number of Years: ");//get the double value from input 3
    String input3 = stdin.readLine();
    numOfYears = Integer.parseInt(input3);
    **Here is the code that calculates, both of these codes compile and run seperately, I just need to combine them!*
    *import java.text.DecimalFormat;
    public class WK3solution{
    public static void main(String[] args)
    //local objects
    WK3solution mortgageCalc = new WK3solution();
    DecimalFormat df = new DecimalFormat("###,##0.00"); // to format the amount.
    DecimalFormat numDf = new DecimalFormat("000"); // to format the sequence number.
    //local variable
    double principal = 200000;
    double annualInterest = 5.75;
    int numOfYears = 30;
    double monthlyInterest = annualInterest/(12*100);
    int totalNumOfMonths = numOfYears*12;
    System.out.println("Payment# LoanBalance InterestPaid");
    int monthCounter=1;
    for(; totalNumOfMonths>0; totalNumOfMonths--){
    //first get the monthly payment...
    double monthlyPayment = mortgageCalc.getMortgageAmount(principal,monthlyInterest,totalNumOfMonths);
    //now get the monthly principal in the payment...
    double monthlyPrincipal = mortgageCalc.getMonthlyPrincipal(monthlyPayment,monthlyInterest,principal);
    principal-=monthlyPrincipal;
    //compare your result with the following url: http://www.jeacle.ie/mortgage/
    System.out.println(numDf.format(monthCounter) + " " df.format(principal) " " +df.format((monthlyPayment-monthlyPrincipal)));
    monthCounter++;
    if(monthCounter%25==0)sleep(1000); // this will hesitate...
    // getMortgageAmount is a simple method that takes 3 arguments, the principal
    // the monthly interest and the number of months.
    public double getMortgageAmount(double principal, double monthlyInterest, int numOfMonths){
    // Monthly payment formula: M = P x (J/(1-(1+J)^-N));
    // M = P * ( J / (1 - (1 + J) ** -N));
    // source: http://www.hughchou.org/calc/formula.html
    double monthlyPayment = (principal*(monthlyInterest / (1-(Math.pow((1+monthlyInterest),(numOfMonths*-1))))));
    return monthlyPayment;
    //calculate the monthly interest using simple interest.
    public double getMonthlyPrincipal(double monthlyPayment, double monthlyInterest, double remainingPrincipal){
    return monthlyPayment - (remainingPrincipal * monthlyInterest);
    // method to make the program sleep (hesitate) for a give time (in milliseconds)..
    public static void sleep(long milliseconds){
    try{
    Thread.sleep(milliseconds);
    }catch(InterruptedException e){
    //do nothing... for now...
    }

    Using the code blocks can help (im not pasting that in my editor for nobody...)

  • Adding an event listener to combo box

    I am working on a mortgage calculator and I cannot figure out how to add an event listener to a combo box.
    I want to get the mortgage term and interest rate to calucate the mortgage using the combo cox. Here is my program.
    Modify the mortgage program to allow the user to input the amount of a mortgage
    and then select from a menu of mortgage loans: 7 year at 5.35%, 15 year at 5.50%, and
    30 year at 5.75%. Use an array for the different loans. Display the mortgage payment
    amount. Then, list the loan balance and interest paid for each payment over the term
    of the loan. Allow the user to loop back and enter a new amount and make a new
    selection, with resulting new values. Allow user to exit if running as an application
    (can't do that for an applet though).
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.text.NumberFormat;
    import java.util.Locale;
    //creates class MortgageCalculator
    public class MortgageCalculator extends JFrame implements ActionListener {
    //creates title for calculator
         JPanel row = new JPanel();
         JLabel mortgageCalculator = new JLabel("MORTGAGE CALCULATOR", JLabel.CENTER);
    //creates labels and text fields for amount entered          
         JPanel firstRow = new JPanel(new GridLayout(3,1,1,1));
         JLabel mortgageLabel = new JLabel("Mortgage Payment $", JLabel.LEFT);
         JTextField mortgageAmount = new JTextField(10);
         JPanel secondRow = new JPanel();
         JLabel termLabel = new JLabel("Mortgage Term/Interest Rate", JLabel.LEFT);
         String[] term = {"7", "15", "30"};
         JComboBox mortgageTerm = new JComboBox(term);
         JPanel thirdRow = new JPanel();
         JLabel interestLabel = new JLabel("Interest Rate (%)", JLabel.LEFT);
         String[] interest = {"5.35", "5.50", "5.75"};
         JComboBox interestRate = new JComboBox(interest);
         JPanel fourthRow = new JPanel(new GridLayout(3, 2, 10, 10));
         JLabel paymentLabel = new JLabel("Monthly Payment $", JLabel.LEFT);
         JTextField monthlyPayment = new JTextField(10);
    //create buttons to calculate payment and clear fields
         JPanel fifthRow = new JPanel(new GridLayout(3, 2, 1, 1));
         JButton calculateButton = new JButton("CALCULATE PAYMENT");
         JButton clearButton = new JButton("CLEAR");
         JButton exitButton = new JButton("EXIT");
    //Display area
         JPanel sixthRow = new JPanel(new GridLayout(2, 2, 10, 10));
         JLabel displayArea = new JLabel(" ", JLabel.LEFT);
         JTextArea textarea = new JTextArea(" ", 8, 50);
    public MortgageCalculator() {
         super("Mortgage Calculator");                     //title of frame
         setSize(550, 350);                                             //size of frame
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         Container pane = getContentPane();
         GridLayout grid = new GridLayout(7, 3, 10, 10);
         pane.setLayout(grid);
         pane.add(row);
         pane.add(mortgageCalculator);
         pane.add(firstRow);
         pane.add(mortgageLabel);
         pane.add(mortgageAmount);
         pane.add(secondRow);
         pane.add(termLabel);
         pane.add(mortgageTerm);
         pane.add(thirdRow);
         pane.add(interestLabel);
         pane.add(interestRate);
         pane.add(fourthRow);
         pane.add(paymentLabel);
         pane.add(monthlyPayment);
         monthlyPayment.setEnabled(false);
         pane.add(fifthRow);
         pane.add(calculateButton);
         pane.add(clearButton);
         pane.add(exitButton);
         pane.add(sixthRow);
         pane.add(textarea); //adds texaarea to frame
         pane.add(displayArea);
         setContentPane(pane);
         setVisible(true);
         //Adds Listener to buttons
         calculateButton.addActionListener(this);
         clearButton.addActionListener(this);
         exitButton.addActionListener(this);
         mortgageTerm.addActionListener(this);
         interestRate.addActionListener(this);
    public void actionPerformed(ActionEvent event) { 
         Object command = event.getSource();
         JComboBox mortgageTerm = (JComboBox)event.getSource();
         String termYear = (String)mortgageTerm.getSelectedItem();
    if (command == calculateButton) //calculates mortgage payment
         int year = Integer.parseInt(mortgageTerm.getText());
         double rate = new Double(interestRate.getText()).doubleValue();
         double mortgage = new Double(mortgageAmount.getText()).doubleValue();
         double interest = rate /100.0 / 12.0;
         double monthly = mortgage *(interest/(1-Math.pow(interest+1,-12.0 * year)));
                   NumberFormat myCurrencyFormatter;
                   myCurrencyFormatter = NumberFormat.getCurrencyInstance(Locale.US);
                   monthlyPayment.setText(myCurrencyFormatter.format(monthly));
         if(command == clearButton) //clears all text fields
                   mortgageAmount.setText(null);
                   //mortgageTerm.setText(null);
                   //interestRate.setText(null);
                   monthlyPayment.setText(null);
              if(command == exitButton) //sets exit button
                        System.exit(0);
         public static void main(String[] arguments) {
              MortgageCalculator mor = new MortgageCalculator();

    The OP already did this to both JComboBoxes.
    mochatay, here is a new actionPerformed method for you to use.
    I've improved a few things here and there...
    1) You can't just cast the ActionEvent's source into a JComboBox!
    What if it was a JButton that fired the event? Then you would get ClassCastExceptions (I'm sure you did)
    So check for all options, what the source of the ActionEvent actually was...
    2) You can't assume the user will always type in valid data.
    So enclose the Integer and Double parse methods in try-catch brakcets.
    Then you can do something when you know that the user has entered invalid input
    (like tell him/her what a clumsy idiot they are !)
    3) As soon as user presses an item in any JComboBox, just re-calculate.
    I did this here by programmatically clicking the 'Calculate' button.
    Alternatively, you could have a 'calculate' method, which does everything inside the
    if(command==calculateButton) if-block.
    This will be called when:
    a)calculateButton is pressed
    b)when either of the JComboBoxes are pressed.
    public void actionPerformed (ActionEvent event)
            Object command = event.getSource ();
            if (command == calculateButton) //calculates mortgage payment
                int year = 0;
                double rate = 0;
                double mortgage = 0;
                double interest = 0;
                /* If user has input invalid data, tell him so
                and return (Exit from this method back to where we were before */
                try
                    year = Integer.parseInt (mortgageTerm.getSelectedItem ().toString ());
                    rate = new Double (interestRate.getSelectedItem ().toString ()).doubleValue ();
                    mortgage = new Double (mortgageAmount.getText ()).doubleValue ();
                    interest = rate / 100.0 / 12.0;
                catch (NumberFormatException nfe)
                    /* Display a message Dialogue box with a message */
                    JOptionPane.showMessageDialog (this, "Error! Invalid input!");
                    return;
                double monthly = mortgage * (interest / (1 - Math.pow (interest + 1, -12.0 * year)));
                NumberFormat myCurrencyFormatter;
                myCurrencyFormatter = NumberFormat.getCurrencyInstance (Locale.US);
                monthlyPayment.setText (myCurrencyFormatter.format (monthly));
            else if (command == clearButton) //clears all text fields
                /* Better than setting it to null (I think) */
                mortgageAmount.setText ("");
                //mortgageTerm.setText(null);
                //interestRate.setText(null);
                monthlyPayment.setText ("");
            else if (command == exitButton) //sets exit button
                System.exit (0);
            else if (command == mortgageTerm)
                /* Programmatically 'clicks' the button,
                As is user had clicked it */
                calculateButton.doClick ();
            else if (command == interestRate)
                calculateButton.doClick ();
            //JComboBox mortgageTerm = (JComboBox) event.getSource ();
            //String termYear = (String) mortgageTerm.getSelectedItem ();
        }Hope this solves your problems.
    I also hope you'll be able to learn from what I've indicated, so you can use similar things yourself
    in future!
    Regards,
    lutha

  • Help with Button

    Hello
    I am working on a simple mortgage program. I can not get the program to compile correctly. The program is supposed to allow the user to input the amout of the mortgage and then select from a menu of loans: 7 year at 5.35%, 15 year at 5.5%, and 30 year at 5.75%. After a loan is selected the mortgage payment amount will display.
    Thank you in advance to anyone that is willing to help me out.
    import javax.swing.JOptionPane;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.text.DecimalFormat;
    public class Mortgage2 implements ActionListener {interface
    JFrame frame;
    JPanel panel;
    JLabel prinLbl, aprLbl, termLbl, pymtLbl;
    JTextField prinTf, aprTf, termTf, pymtTf;
    JButton calcBtn;
    JButton mortBtn1;
    JButton mortBtn2;
    JButton mortBtn3;
    public Mortgage2()
    frame = new JFrame("Mortgage Calculator");
    frame = new JFrame("By: Kalei");
    panel = new JPanel();
    panel.setLayout(new GridLayout(5,2));
    prinLbl = new JLabel ("Amount of the Mortgage");
    prinTf = new JTextField (0);
    aprTf = new JTextField (0);
    termTf = new JTextField (0);
    pymtTf = new JTextField(0);
    prinLbl = new JLabel ("Select a Mortgage Plan");
    mortBtn1 = new JButton ("7 Year @ 5.35%");
    mortBtn2 = new JButton ("15 Year @ 5.5%");
    mortBtn3 = new JButton ("30 Year @ 5.75%");
    pymtLbl = new JLabel ("The monthly Mortgage payment");
    calcBtn = new JButton ("Calculate");
    panel.add(prinLbl);
    panel.add(prinTf);
    panel.add(aprLbl);
    panel.add(aprTf);
    panel.add(termLbl);
    panel.add(termTf);
    panel.add(pymtLbl);
    panel.add(pymtTf);
    panel.add(mortBtn1);
    panel.add(mortBtn2);
    panel.add(mortBtn3);
    panel.add(calcBtn);
    frame.getContentPane().add(panel, BorderLayout.CENTER);
    mortBtn1.addActionListener(this);
    mortBtn2.addActionListener(this);
    mortBtn3.addActionListener(this);
    calcBtn.addActionListener(new calcBtnlistener ());
    frame.setSize(400,300);
    frame.setLocation(200,100);
    frame.setVisible(true);
    }// end of Mortgage3
    public static void main (String[] args) {
    new Mortgage();
         // Handler for the "Calculate" button
    class calcBtnlistener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    double apr = 5.75, years = 30.0, pv = 200000;
    // The calculations are done as follows.
    double r = apr / 100.0 / 12.0;
    double n = years * 12.0;
    double pymt = pv * r / (1.0 - Math.pow((1.0 + r), -n));
    pymtTf.setText("" + pymt);
    }}

    You are right I copied parts of the code. I am still new to Java and I thought that using pieces of people's code was an acceptable practice. I would like to apologize if that was wrong. I did however post the wrong code. I posted the code word for word and I meant to post my own code that I used information from your code in. If this is wrong I will take the information I used out because I seriously don't want to cheat. The code below is my own that I have been modifying for the past 8 weeks in a Java programming class. The class is on line so it is hard to get help from classmates.
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.JOptionPane;
    import java.text.DecimalFormat; //this class displays decimal format
    public class Mortgage2 extends JPanel implements ActionListener
         JFrame frame = new JFrame ("Mortgage Calculator");
         JPanel panel = new JPanel ();
         JFrame frame = new JFrame ("Please Select a Loan Term");
         JButton mort1 = new JButton ("7 Year at 5.35%");
         JButton mort2 = new JButton ("15 Year at 5.5%");
         JButton mort3 = new JButton ("30 Year at 5.75%");
         JButton exit = new JButton ("Exit the Calculator");
         JLabel pay = new JLabel ("The Monthly Payment");
         JScrollPane scroll = new JScrollPane(pane);
         public Mortgage2
         super ("Calculator");
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         panel.setLayout(new GridLayout(5,2));
         panel.add(pay);
         panel.add(exit);
         panel.add(mort1);
         panel.add(mort2);
         panel.add(mort3);
         mort1.addActionListener(this);
         mort2.addActionListener(this);
         mort3.addActionListener(this);
         }//end Mortgage2
         public static void main(String[] args)
              frame.getContentPane().add(panel, BorderLayout.CENTER);
              frame.setSize(400,300);
              frame.setLocation(200,100);
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e)
              //declare class variables values
              mortgage = 200000.00;
              principal = 200000.00; //the current mortgage amount of the loan
              interestRateYears = .0575;
              interestRateMonths = (interestRateYears / 12) / 100;
              termYears = 30;
              termMonths = (termYears * 12);
              monthlyInterestPayment = 0;
              monthlyPrincipalPayment = 0;
              balance = principal;
              linecount = 15;
              //this text formats the numbers to display two decimal places
              java.text.DecimalFormat dec = new java.text.DecimalFormat ("###.00");
              //calculations
              mortgage = ((200000*.0575)+200000)/360; //monthly payment from week 2 program
              monthlyPayment = (principal * interestRateMonths) /
              (1 - Math.pow(1 + interestRateMonths, - termMonths));  //calculation retrieved from Dr math
              // formula to calculate monthly interest and principal payments
              monthlyInterestPayment = (balance * interestRateMonths);
              monthlyPrincipalPayment = (monthlyPayment - monthlyInterestPayment);  //retrieved from Dr math
              // start while loop
              while (termMonths > 0)
              // information to display
              System.out.println(termMonths + "\t\t$" + dec.format(monthlyPrincipalPayment) +
              "\t\t$" + dec.format(monthlyInterestPayment) +
              "\t\t$" + dec.format(balance));
              // decrement months
              termMonths--;
             // calculate interest and principal payments
              monthlyInterestPayment = (balance * interestRateMonths);
              monthlyPrincipalPayment = (monthlyPayment - monthlyInterestPayment);
              balance = (balance - monthlyInterestPayment);
                   // these conditional statements cause the results to pause
                   if(linecount == 20)
                   linecount = 0;
                   try
                   Thread.sleep(3000);          // pause to last three seconds
                   catch (InterruptedException e)
                   }     // end if
                   else
                        linecount++;
                   }     // end else
                   }            // end while
         } // end main
    } //end program

  • CSS not displaying in Dreamweaver Preview (from Template file)

    Greetings!
    I created a page in dreamweaver with attached styles which was working just fine. Took the page and turned it into a template - which was also working fine.
    Then applied the template to a page and styles are not showing at all.
    Looking at the code my stylesheet is attached properly and uploading the page to a live server, the styles all display fine. It is just Dreamweavers is somehow not rendering the stylesheet.
    I have double checked and ensured that the rendering of css is turned on. That the media is set to screen etc. Still I cannot get the CSS to render in design view.
    As a temporary workaround, I can re-attach my stylesheet as a design time stylesheet and it renders just fine.
    Anyone have any ideas what might be happening here? Is it a Dreamweaver cache issue?
    Only thing I can think is that I do have some PHP code in the head section, but the page is a PHP page so that should not be an issue?
    I would appreciate any help or ideas anyone can offer!
    Thanks,
    Martin

    Here is the template:
    <!doctype html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    </head>
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <link href="../style-mobile.css" rel="stylesheet" type="text/css">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=yes, width=device-width" />
        <script type="text/javascript" charset="utf-8" src="../home-panels_edgePreload.js"></script>
        <style>
            .edgeLoad-EDGE-437364888 { visibility:hidden; }
        </style>
    <link rel="stylesheet" type="text/css" href="../slimmenu.css">
    <script src="../jquery.min.js"></script>
    <script src="../jquery.slimmenu.js"></script>
    <script src="../jquery.easing.min.js"></script>
    <body>
    <ul class="slimmenu">
            <div class="nav-phone"><span class="callus">Call Us Now:</span> <a href="tel:18888021296">1-888-802-1296</a></div>
            <li><a href="../how-biweekly-mortgages-work.html">How it Works</a></li>
            <li><a href="../why-biweekly-mortgage-company.html">Why Us?</a></li>
            <li><a href="../faq-biweekly-interest-savings.html">Frequently Asked Questions</a></li>
            <li><a href="../biweekly-mortgage-testimonials.html">Testimonials</a></li>
            <li><a href="../biweekly-mortgage-videos.html">Video Library</a></li>
            <li><a href="../biweekly-mortgage-resources.html">Resources</a></li>
            <li><a href="../biweekly-customer-service.html">Contact Us</a></li>
            <li><a href="../careers-xenia-ohio.html">Careers</a></li>
            <li><a href="https://nbabiweekly.com/secure/change_form2.htm" target="_blank">Update Account Info</a></li>
    </ul>
    <script>
    $('ul.slimmenu').slimmenu(
        resizeWidth: '2000',
        collapserTitle: '<img src="images/logo.png" width="275" height="51">',
        easingEffect:'easeInOutQuint',
        animSpeed:'medium',
        indentChildren: true,
        childrenIndenter: '&raquo;'
    </script><!-- TemplateBeginEditable name="Content" -->
    <div id="content">
      <div id="home-panels">
        <div id="panels" onClick="location.href='http://www.youtube.com/embed/LZPHZQLUnHE?rel=0';" style="cursor:pointer;">
          <!--Adobe Edge Runtime-->
          <div id="Stage" class="EDGE-437364888"></div>
          <!--Adobe Edge Runtime End-->
        </div>
        <div id="intro-text">Nationwide Biweekly Administration's Interest Minimizer—A simple change from monthly to bi-weekly payments can save you thousands of dollars and years off your  mortgage, auto, student, and other loans as well as credit card debt.</div>
        <div id="home-call">
          <div class="24" id="home-call-now"> Call Now </div>
          <div id="home-call-number"> <a href="tel://1-888-802-1296">888-802-1296</a></div>
        </div>
      </div>
      <div class="divider-white"></div>
      <div class="home-blue" onClick="location.href='biweekly-mortgage-videos.html';">
        <div id="home-video-library">
          <div id="home-video-library-left">
            <div class="title-white"> Video Library </div>
            <div id="home-video-copy" class="copy-blue"> Learn more about NBA and the Interest Minimizer Bi-weekly Program with these selected videos.</div>
          </div>
          <!--        <div id="home-video-library-right">
            </div>-->
        </div>
        <!--home-video-library-end-->
      </div>
      <div class="divider-white"></div>
      <div id="home-orange">
        <div id="home-orange-box" class="title-white"> In 2012, we... </div>
        <div id="home-2012-bullets">
          <ul>
            <li>Processed over a BILLION dollars! </li>
            <li>Saved consumers $113,994,000 in interest!</li>
            <li>Generated a $110,142,000 equity benifit! </li>
            <li>Saved consumers 705,410  payments!</li>
          </ul>
        </div>
      </div>
      <div class="divider-white"></div>
      <div id="home-cream">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td colspan="3" valign="top"><center>
              More Reasons to Trust NBA
            </center></td>
          </tr>
          <tr>
            <td width="37%" align="center" valign="middle"><img src="../images/bbb.png" width="98" height="61"></td>
            <td width="30%" align="center" valign="middle"><img src="../images/audit.png" width="90" height="89"></td>
            <td width="33%" align="center" valign="middle"><img src="../images/db.png" width="67" height="76"></td>
          </tr>
        </table>
      </div>
      <div class="divider-white"></div>
      <div class="home-blue" onClick="location.href='https://nbabiweekly.com/secure/change_form2.htm';">
        <div id="home-account-left">
          <div class="title-white"> Update Account Info</div>
          <div id="home-account-copy" class="copy-blue"> Update your account information or restart your enrollment using our SECURE online form. </div>
        </div>
      </div>
      <div class="divider-white"></div>
    </div>
    <!-- TemplateEndEditable -->
    <div id="footer">
    <div id="social">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="20%"><center>
            <a href="http://www.linkedin.com/company/978505?trk=tyah"><img src="../images/social-in.png" alt="LinkedIn" width="35" height="35" border="0"></a>
          </center></td>
          <td width="20%"><center>
            <a href="https://www.facebook.com/NationwideBiweekly"><img src="../images/social-fb.png" width="35" height="35" alt="Facebook"></a>
          </center></td>
          <td width="20%"><center>
            <a href="https://twitter.com/NBAsavesyou"><img src="../images/social-twitter.png" width="35" height="35" alt="Twitter"></a>
          </center></td>
          <td width="20%"><center>
            <a href="http://nationwidebiweeklyblog.com/"><img src="../images/social-blog.png" width="35" height="35" alt="Biweekly Mortgage Program Blog"></a>
          </center></td>
          <td width="20%"><center>
            <a href="http://www.youtube.com/user/nbabiweeklysaver?feature=watch"><img src="../images/social-yt.png" width="35" height="35" alt="YouTube"></a>
          </center></td>
        </tr>
      </table>
    </div>
    <div class="divider-footer"></div>
      <div class="footer-links">
        <div class="footer-title">Learn More</div>
        <div id="footer-links1">
        <a href="../how-biweekly-mortgages-work.html">How It Works</a>
        <a href="../why-biweekly-mortgage-company.html">Why Us?</a> <a href="../faq-biweekly-interest-savings.html">FAQ</a> <a href="../biweekly-mortgage-testimonials.html">Testimonials</a></div>
      </div>
    <div class="divider-footer"></div>
      <div class="footer-links">
        <div class="footer-title">Video Library</div>
        <div id="footer-links2">
        <a href="../biweekly-mortgage-testimonials.html">Testimonials</a> <a href="../biweekly-mortgage-videos.html">Biweekly Mortgage Program</a> <a href="../biweekly-mortgage-videos.html">Featured on Oprah &amp; CBS News</a>
        <a href="../biweekly-mortgage-videos.html">Certified Audit of Procedures</a>
         <a href="../biweekly-mortgage-videos.html">How Are My Payments Processed?</a>
         <a href="../biweekly-mortgage-videos.html">NBA Video Tour</a>
         <a href="../faq-biweekly-interest-savings.html">Frequently Asked Questions</a>
         <a href="../careers-xenia-ohio.html">Careers at NBA</a>
        </div>
      </div>
    <div class="divider-footer"></div>
       <div class="footer-links">
        <div class="footer-title">Resources</div>
        <div id="footer-links1">
        <a href="http://nationwidebiweeklyblog.com/">Blog</a> <a href="http://www.interestminimizer.com/audit-form.html" target="_blank">Free Annual Audit</a> <a href="http://www.interestminimizer.com/calendar.html" target="_blank">Withdrawal Schedule</a> <a href="http://www.nbabiweekly.com/lenderlist1_interface/qryMortgageCompanyExport/LenderNameSearch 2.asp" target="_blank">Lender Search</a></div>
      </div>
       <div class="divider-footer"></div>
          <div class="footer-links">
        <div class="footer-title">Interact with NBA</div>
        <div id="footer-links1">
        <a href="../biweekly-customer-service.html">Contact Us</a> <a href="../careers-xenia-ohio.html">Careers</a> <a href="https://nbabiweekly.com/secure/change_form2.htm" target="_blank">Update Account Info</a>
        </div>
      </div>
      <div class="divider-footer"></div>
      <div id="footer-bottom">
        <p>Nationwide Biweekly Administration<br>
          <span class="blue-small">Helping Millions Save Billions
        </span></p>
            <p class="blue-small">Georgia customers go <a href="../georgia.html">HERE</a> for licensing information.
        report any customer concerns.</p>
        <p class="blue-small">Texas customers click <a href="../texas.html">HERE</a> to
        report any customer concerns.</p>
        <p class="blue-small">Loan Payment Administration is a subsidiary of Nationwide Biweekly Administration</p>
        <p class="blue-xxsmall">Copyright &copy; 2013 Nationwide Biweekly Administration</p>
      </div>
    </div>
    </body>
    </html>
    Here is a child:
    <!doctype html>
    <html><!-- InstanceBegin template="/Templates/main-mobile.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->
    </head>
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- InstanceEndEditable -->
    <link href="style-mobile.css" rel="stylesheet" type="text/css">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=yes, width=device-width" />
        <script type="text/javascript" charset="utf-8" src="home-panels_edgePreload.js"></script>
        <style>
            .edgeLoad-EDGE-437364888 { visibility:hidden; }
        </style>
    <link rel="stylesheet" type="text/css" href="slimmenu.css">
    <script src="jquery.min.js"></script>
    <script src="jquery.slimmenu.js"></script>
    <script src="jquery.easing.min.js"></script>
    <body>
    <ul class="slimmenu">
            <div class="nav-phone"><span class="callus">Call Us Now:</span> <a href="tel:18888021296">1-888-802-1296</a></div>
            <li><a href="how-biweekly-mortgages-work.html">How it Works</a></li>
            <li><a href="why-biweekly-mortgage-company.html">Why Us?</a></li>
            <li><a href="faq-biweekly-interest-savings.html">Frequently Asked Questions</a></li>
            <li><a href="biweekly-mortgage-testimonials.html">Testimonials</a></li>
            <li><a href="biweekly-mortgage-videos.html">Video Library</a></li>
            <li><a href="biweekly-mortgage-resources.html">Resources</a></li>
            <li><a href="biweekly-customer-service.html">Contact Us</a></li>
            <li><a href="careers-xenia-ohio.html">Careers</a></li>
            <li><a href="https://nbabiweekly.com/secure/change_form2.htm" target="_blank">Update Account Info</a></li>
    </ul>
    <script>
    $('ul.slimmenu').slimmenu(
        resizeWidth: '2000',
        collapserTitle: '<img src="images/logo.png" width="275" height="51">',
        easingEffect:'easeInOutQuint',
        animSpeed:'medium',
        indentChildren: true,
        childrenIndenter: '&raquo;'
    </script><!-- InstanceBeginEditable name="Content" -->
    <div id="content">
      <div id="home-panels">
        <div id="panels" onClick="location.href='http://www.youtube.com/embed/LZPHZQLUnHE?rel=0';" style="cursor:pointer;">
          <!--Adobe Edge Runtime-->
          <div id="Stage" class="EDGE-437364888"></div>
          <!--Adobe Edge Runtime End-->
        </div>
        <div id="intro-text">Nationwide Biweekly Administration's Interest Minimizer—A simple change from monthly to bi-weekly payments can save you thousands of dollars and years off your  mortgage, auto, student, and other loans as well as credit card debt.</div>
        <div id="home-call">
          <div class="24" id="home-call-now"> Call Now </div>
          <div id="home-call-number"> <a href="tel://1-888-802-1296">888-802-1296</a></div>
        </div>
      </div>
      <div class="divider-white"></div>
      <div class="home-blue" onClick="location.href='biweekly-mortgage-videos.html';">
        <div id="home-video-library">
          <div id="home-video-library-left">
            <div class="title-white"> Video Library </div>
            <div id="home-video-copy" class="copy-blue"> Learn more about NBA and the Interest Minimizer Bi-weekly Program with these selected videos.</div>
          </div>
          <!--        <div id="home-video-library-right">
            </div>-->
        </div>
        <!--home-video-library-end-->
      </div>
      <div class="divider-white"></div>
      <div id="home-orange">
        <div id="home-orange-box" class="title-white"> In 2012, we... </div>
        <div id="home-2012-bullets">
          <ul>
            <li>Processed over a BILLION dollars! </li>
            <li>Saved consumers $113,994,000 in interest!</li>
            <li>Generated a $110,142,000 equity benifit! </li>
            <li>Saved consumers 705,410  payments!</li>
          </ul>
        </div>
      </div>
      <div class="divider-white"></div>
      <div id="home-cream">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td colspan="3" valign="top"><center>
              More Reasons to Trust NBA
            </center></td>
          </tr>
          <tr>
            <td width="37%" align="center" valign="middle"><img src="images/bbb.png" width="98" height="61"></td>
            <td width="30%" align="center" valign="middle"><img src="images/audit.png" width="90" height="89"></td>
            <td width="33%" align="center" valign="middle"><img src="images/db.png" width="67" height="76"></td>
          </tr>
        </table>
      </div>
      <div class="divider-white"></div>
      <div class="home-blue" onClick="location.href='https://nbabiweekly.com/secure/change_form2.htm';">
        <div id="home-account-left">
          <div class="title-white"> Update Account Info</div>
          <div id="home-account-copy" class="copy-blue"> Update your account information or restart your enrollment using our SECURE online form. </div>
        </div>
      </div>
      <div class="divider-white"></div>
    </div>
    <!-- InstanceEndEditable -->
    <div id="footer">
    <div id="social">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="20%"><center>
            <a href="http://www.linkedin.com/company/978505?trk=tyah"><img src="images/social-in.png" alt="LinkedIn" width="35" height="35" border="0"></a>
          </center></td>
          <td width="20%"><center>
            <a href="https://www.facebook.com/NationwideBiweekly"><img src="images/social-fb.png" width="35" height="35" alt="Facebook"></a>
          </center></td>
          <td width="20%"><center>
            <a href="https://twitter.com/NBAsavesyou"><img src="images/social-twitter.png" width="35" height="35" alt="Twitter"></a>
          </center></td>
          <td width="20%"><center>
            <a href="http://nationwidebiweeklyblog.com/"><img src="images/social-blog.png" width="35" height="35" alt="Biweekly Mortgage Program Blog"></a>
          </center></td>
          <td width="20%"><center>
            <a href="http://www.youtube.com/user/nbabiweeklysaver?feature=watch"><img src="images/social-yt.png" width="35" height="35" alt="YouTube"></a>
          </center></td>
        </tr>
      </table>
    </div>
    <div class="divider-footer"></div>
      <div class="footer-links">
        <div class="footer-title">Learn More</div>
        <div id="footer-links1">
        <a href="how-biweekly-mortgages-work.html">How It Works</a>
        <a href="why-biweekly-mortgage-company.html">Why Us?</a> <a href="faq-biweekly-interest-savings.html">FAQ</a> <a href="biweekly-mortgage-testimonials.html">Testimonials</a></div>
      </div>
    <div class="divider-footer"></div>
      <div class="footer-links">
        <div class="footer-title">Video Library</div>
        <div id="footer-links2">
        <a href="biweekly-mortgage-testimonials.html">Testimonials</a> <a href="biweekly-mortgage-videos.html">Biweekly Mortgage Program</a> <a href="biweekly-mortgage-videos.html">Featured on Oprah &amp; CBS News</a>
        <a href="biweekly-mortgage-videos.html">Certified Audit of Procedures</a>
         <a href="biweekly-mortgage-videos.html">How Are My Payments Processed?</a>
         <a href="biweekly-mortgage-videos.html">NBA Video Tour</a>
         <a href="faq-biweekly-interest-savings.html">Frequently Asked Questions</a>
         <a href="careers-xenia-ohio.html">Careers at NBA</a>
        </div>
      </div>
    <div class="divider-footer"></div>
       <div class="footer-links">
        <div class="footer-title">Resources</div>
        <div id="footer-links1">
        <a href="http://nationwidebiweeklyblog.com/">Blog</a> <a href="http://www.interestminimizer.com/audit-form.html" target="_blank">Free Annual Audit</a> <a href="http://www.interestminimizer.com/calendar.html" target="_blank">Withdrawal Schedule</a> <a href="http://www.nbabiweekly.com/lenderlist1_interface/qryMortgageCompanyExport/LenderNameSearch 2.asp" target="_blank">Lender Search</a></div>
      </div>
       <div class="divider-footer"></div>
          <div class="footer-links">
        <div class="footer-title">Interact with NBA</div>
        <div id="footer-links1">
        <a href="biweekly-customer-service.html">Contact Us</a> <a href="careers-xenia-ohio.html">Careers</a> <a href="https://nbabiweekly.com/secure/change_form2.htm" target="_blank">Update Account Info</a>
        </div>
      </div>
      <div class="divider-footer"></div>
      <div id="footer-bottom">
        <p>Nationwide Biweekly Administration<br>
          <span class="blue-small">Helping Millions Save Billions
        </span></p>
            <p class="blue-small">Georgia customers go <a href="georgia.html">HERE</a> for licensing information.
        report any customer concerns.</p>
        <p class="blue-small">Texas customers click <a href="texas.html">HERE</a> to
        report any customer concerns.</p>
        <p class="blue-small">Loan Payment Administration is a subsidiary of Nationwide Biweekly Administration</p>
        <p class="blue-xxsmall">Copyright &copy; 2013 Nationwide Biweekly Administration</p>
      </div>
    </div>
    </body>
    <!-- InstanceEnd --></html>

  • Need minor credit boost for first home

    Evening all, First post on the forums. I hope this is not in the wrong section as I was not sure whether to post in the mortgage section or the credit repair section. Kind of a long story but here it goes. My GF and I (23 and 25) are preparing to buy our first home. We do not have much money to put down, so we are looking into the 100% Financing option from Navy Federal (We have already been pre-approved for an FHA loan through Navy Federal, but would like to go for the 100% Financing as this program requires no PMI). However, the limit for the tier 1 interest rates for this program is 720+. The tier 2 interest rates would give us about the same monthly payments as the FHA, so I figure going for the tier 1 rates is the only option for a lower payment. My GF has credit scores between 740-760, but I am sitting at 695 (Eq), 697 (Ex) and 718 (TU). I was lower back in April (660ish), but since then I have paid off ALL credit card debt (was previously around 80% utilization) and I got a negative remark removed from my account that did not belong to me. However, I still have student loans that I am repaying, one of which belongs to Campus Partners. Unfortunately, last year I ran into medical problems on two occassions (related, but occurred at different times of the year) and the quarterly payment for my student loan totally slipped my mind (I wish it had been monthly instead of quarterly). Thus, I have a 30 day late for Campus Partners from February 2014 and a 60 day late from Nov/Dec, which I then paid off the loan in full. I have sent Goodwill Letters (multiples) to Campus Partners (As well as emailed the letter to the Presdient and Financial CEO) with the same response everytime saying they MUST report all data (The most recent response today had multiple portions bolded--I get the feeling they are getting annoyed by me :-P). I am going to continue sending in letters with the hopes that they have a change of heart (unlikely), but am looking for any way to improve my credit 20-25 points so that we may qualify for the mortgage program we desire. My AAoA is not great (3.5 years roughly), but I have no credit card utilization, and just those 2 late payments on my credit. My father offered to put me on one of his credit cards as an authorized user, but I do not know if this will work or if the mortgage lender will accept it in my credit report (will they throw it out for the mortgage loan?). Will just paying bills on time and using/paying off my CC every month increase my credit in a reasonable time, or will this be a very slow process with those late payments tarnishing me? If anyone has any advice to improve my credit by roughly 20 points quickly, it would be greatly appreciated.

    MProphet90 wrote:
    Thank you both for the replies. It is appreciated. Unfortunately Marlena my GF does not have the salary to qualify on her own while allowing us to buy a decent home (living in Maryland where the homes are priced ridiculously). Revelate, Do you have a link or any information on how to go about removing a tradeline? I have several other student loans so I believe if I was to remove the one with the late payments it would only improve my credit even though I am losing a tradeline. The only response I receive to my GW letters is that they are required to report all information, so not sure how open they would be to removing the tradeline completely :-/ Does anyone know how being an authorized user on a CC affects your mortgage status? Will a bank deny you if they see this or just factor that account out of your credit report? I know Navy Federal uses your standard mortgage score versions (posted in the sticky thread in these forums) so I am not sure how these versions reflect authorized user data.Won't deny you for having an AU, might ask you to remove it worst case but that's becoming really rare from some reports here.  I don't think anyone really cares anymore if you can jump through the rest of the hoops required to get a mortgage, if you pass the credit score sniff test you'll be OK is my read of the situation.  Might try to factor it out but that's sort of impossible and would be all sorts of sticky, with your own credit history I don't think anyone would even blink.  I would suggest both are irrelevant if you're trying to clear a FICO hurdle. AU in general only helps if:1) It changes your utilization calculation in a good way (high limit, $0 balance ideal)2) It improves your AAOA by being longer than your other tradelines (or the average of them to be specific, earlier open date the better) - not sure that's the case here.3) Of course, needs to be a pristine tradeline If you think it'll help in your situation meeting those critera, I'd add it personally.  AU's will be counted under all of the mortgage trifecta so there's no problem on that count. Regarding addressing the 60 day late, hit the Rebuilding forum as the experts live there and I'm not one of them on that subject; sometimes OC's have been known to just whack the whole tradeline, what I was trying to get across was any way you can get that off, just take it, even if it comes up with a compromise of they'll delete the account record if you stop bothering them rather than just nullifying the lates.

  • So confused!!

    I need to install Windows on my mac so that I can download a mortgage program that I use.
    I am nervous about installing windows because of virus' & I dont want it to slow my mac down. Will either of these things happen?
    I am a first time mac owner. I think I can get away with using bootcamp to install windows and then the mortgage program. I dont think I need it to run simultaneously but again this all new to me!
    I have had my mac for 2 months and not sure when I even need windows so far...I dont think I have felt the effects of not having it??? That is why I think I can use bootcamp and not parallel. What do you think? Are there other things I would need windows to run simultaneously?
    And what exact windows should I get? Cause I need to install it before Tues afternoon.
    Thanks so much!

    Will either of these things happen?
    Without AV software, all installations of Windows are vulnerable to viruses.
    It will not slow down your Mac, as Windows viruses do not affect OS X.

  • New (and old) battery drains at 1% per 90 seconds

    My battery for my late 2008 macbook (aluminum) was draining at a rate of 1% charge every 90 seconds or so. One time recently, I received a warning at the battery icon saying "replace soon" or something of the sort...so I assumed it was the battery.
    I ordered a replacement battery; received it today and plugged it in - I assumed I'd be golden. I cannot believe it...but it is draining at the same rate! I just timed it and it took 87 seconds to drop 1% in charge.
    A few things have changed since I started noticing this problem, and I'm wondering if there is any remedy.
    I upgraded my RAM from 2GB to 8GB
    I upgraded my hard drive from 160GB to 500GB (hybrid drive)
    I started using VMware Fusion to run a windows based program
    From everything I've seen the first 2 will not cause significant change in battery life, but the 3rd may. I just checked my activity monitor...and while not actively in the VMware screen...that application is constantly using about 15% of my CPU (with a mortgage program and Explorer open). If I shut down Explorer, the CPU activity drops to 6%, and it lasts another 30 seconds - to 2 minutes.
    HOWEVER, both shutting down the mortage program (nothing open in VMware) AND closing VMware all together - still causes the battery to drain at 1% every 2 minutes. Nothing else but Word / Excel / Safari open. This seems insane. Obviously, my new battery is giving me the same results as the old one.
    Any suggestions on how I can extend the battery life past this abismal drain rate? (while writing this, and conducting the iterations above, I dropped from 35% to 9%). I appreciate any and all suggestions!!!!!!!!!
    Colin

    The catch 22 you will be in is this...
    Our normal suggestion to correct a battery issue will be to either cycle the battery and then if that doesn't work to do a full restore using "set up as new iPhone"... Doing a restore does NOT allow you to restore to an OLD OS version like 3.0.1, so if the battery cycling does not work for you, you will be forced to 3.1.2 (which is not at all a bad thing)
    Battery cycle is done by allowing iPhone to fully drain, to the point it shuts itself off...then charge via wall outlet to 100%, then allow to drain fully and shut itself off... doing this 2-3 times usually works to correct battery issues... if not then the restore is needed and that will move you to 3.1.2...
    I have two iPhones on 3.1.2 and have no issues... and there have been several bug fixes since 3.0.1

Maybe you are looking for

  • The segment contains no receivers:: Message no. GA733,

    Hi, I am facing one  problem in executing KSWB (Plan periodic reposting) The scenario is like we are transfering the acutal cost to plan cost by cj9cs. Subsequently , We want to repost the cost from Plan version to Receiver WBSE . CJ9CS went off succ

  • How to create an audit trail file and what is it ( pls see the code)

    All my System.out.println statements , should be printed in an audit file , instead of printing to a console . How and where in the program , i should create a file and how should i write System.out.println statements output to it . Pls help me with

  • Connect Laptop to Sun 5500

    Hello, I am new to Sun hardware, but have spent many many hours using the Solaris O/S. I have recently been asked to set up a lab for my team and was given a Sun 5500 as my first project. They have given me complete control to do whatever I want with

  • Break out of event

    Seems kind of simple, but I am wondering how I can exit the execution of an event, like the way I do in Validate (true or false;). Is it exit; or something?

  • Merging layers then using smart sharpening

    I have been trying to apply smart sharpening to multi layers by creating copies of the layers, merging the copies then using smart sharpening on the merge. The change shows in the smart sharpening dialogue and I can see the change in the merged layer