Solved

Mortgage Calculator

Posted on 2007-03-26
15
728 Views
Last Modified: 2013-11-23
I can not figure out how to get my combo box and arrays working any help would be grealy appreciated. This is what I have so for.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

import javax.swing.text.*;
import java.util.Locale;
import javax.swing.JScrollPane;
import javax.swing.JOptionPane;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;

import java.text.*;



public class POS407_W3_RMR extends JPanel
                          implements ActionListener {
    JLabel picture;

    //creating variables

     public double monthly_interest;
     public double monthly_payment;
       public double number_payments;
       public double new_principle;
       public double m_principle;
       public double cm_interest;
       public double mortint;
       double new_balance;

     //Create Labels
       private JLabel ownerLabel;
       private JLabel assignmentLabel;
       private JLabel separatorLabel;
       private JLabel termLabel;
       private JLabel principleLabel;
       private JLabel yearLabel;
       private JLabel monthlyLabel;
       private JLabel fillerLabel;


       //Value for Fields
       double principal;
       double rate;
       int term;
       int pos;


       //Create the text fields and set them up.
       JTextField principalField = new JTextField("100000");
       JTextField termField = new JTextField("7");
       JTextField rateField = new JTextField(".0535");
       JTextField paymentField = new JTextField(10);


     //Create Buttons
       private JButton calculateButton;
       private JButton exitButton;



       //Strings for the labels
       private static String ownerString = "Name : Rebecca Ragucci";
       private static String assignmentString = "Assignment : POS407 Workshop 3";
       private static String separatorString  = "--------------------------------------------------";


     //Create JTextArea and JScrollPane
       JTextArea displayArea = new JTextArea(10,55);
       JScrollPane scroll = new JScrollPane(displayArea);


    public POS407_W3_RMR() {
        super(new BorderLayout());

        String[] petStrings = { "7 years at 5.35", "4years", "30years", "40years", "50years" };
        String termArray [] = {"7","4","30","40","50"};
        String rateArray [] = {"5.35","7.57","5.75","5.65","5.45"};




        //Define Panels
            JPanel headingPane = new JPanel(new GridLayout(0,1));
            JPanel termPane = new JPanel(new GridLayout(0,1));
            JPanel principlePane = new JPanel(new GridLayout(0,1));
            JPanel textPane = new JPanel(new GridLayout(0,2));
            JPanel comboPane = new JPanel(new GridLayout(0,1));

            //Define Labels
            ownerLabel = new JLabel(ownerString);
            assignmentLabel = new JLabel(assignmentString);
            separatorLabel = new JLabel(separatorString);
            principleLabel = new JLabel("Principle: ");
            monthlyLabel = new JLabel("Monthly Payment:$ ");
            fillerLabel = new JLabel("Year / APR%");

            //Define Heading
          headingPane.add(ownerLabel);
        headingPane.add(assignmentLabel);
            headingPane.add(separatorLabel);


        //New JPanel
            JPanel actionPane = new JPanel(new GridLayout(0,1));

        //Define Buttons
          calculateButton = new JButton("Calculate");
            exitButton = new JButton("Exit");


        //Create the combo box, select the item at index 4.

        JComboBox comboBox = new JComboBox();


        JComboBox petList = new JComboBox(petStrings);
        petList.setSelectedIndex(4);
        petList.addActionListener(this);

        //Define Text Pane
        textPane.add(principleLabel);
            textPane.add(principalField);
            textPane.add(fillerLabel);
            textPane.add(petList);
            textPane.add(monthlyLabel);
            textPane.add(paymentField);
            textPane.add(calculateButton);
            textPane.add(exitButton);


            calculateButton.addActionListener(this);
            exitButton.addActionListener(this);




        //Lay out

         setBorder(BorderFactory.createEmptyBorder(10,10,10,10));

             add(headingPane, BorderLayout.PAGE_START);
             add(actionPane,BorderLayout.PAGE_END);
             add(textPane,BorderLayout.CENTER);

         //setting up scroll bars
             scroll.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
             actionPane.add(scroll);




    }



    /** Listens to the combo box. */
    public void actionPerformed(ActionEvent e)

    {

             DecimalFormat pTwo = new DecimalFormat("0.00");

             Object source = e.getSource();
             if (source == calculateButton)
             {
          //int index = petList.getSelectedIndex();
          //term = termArray[index];
          //rate = rateArray[index];

                //term = Integer.parseInt(termField.getText());
                //principal = Double.parseDouble(principalField.getText());
                  //rate = Double.parseDouble(rateField.getText());
                //principal = 100000.00;
                //term = 7;
                  //rate = .0535;
                        number_payments = (term * 12);

                        rate = (rate / 100);

                        monthly_interest = (rate  / 12);

                        monthly_payment = (principal * monthly_interest) / (1 - Math.pow(1/ (1 + monthly_interest), number_payments));

                        paymentField.setText(pTwo.format(monthly_payment));



            new_principle = principal;
            String titles = "Month\t Principal\t\tInterest\t\t\tBalance\n";
                  displayArea.setText(titles);

            for(int counter = 0; counter <number_payments; counter++)
                  {
                        //Scroll Area


                        cm_interest = new_principle * monthly_interest;    //current monthly interest

                    m_principle= monthly_payment - cm_interest ;
                                                                  /* this is your monthly payment minus your monthly interest,
                                                                                       so it is the amount of principal you pay for that month */

                        new_balance = new_principle - m_principle;
                                                                  /*this is the new balance of your principal of your loan*/

                        new_principle = new_balance;

                        mortint = cm_interest * 100;

                //displayArea.setCaretPosition(0);
                        displayArea.append((counter + 1) + ")\t" + pTwo.format(m_principle) + "\t\t" + pTwo.format(mortint)+ "\t\t" + pTwo.format(new_balance) + "\n");

                  }



            }
                  else if (source == exitButton)
                  {
                     System.exit(0);
            }

              JComboBox cb = (JComboBox)e.getSource();
              String petName = (String)cb.getSelectedItem();

    }


    private static void RShowGUI() {
        //Create and set up the window.
        JFrame frame = new JFrame("Rebecca'a Mortgage Calc");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //Create and set up the content pane.
        JComponent newContentPane = new POS407_W3_RMR();
        newContentPane.setOpaque(true); //content panes must be opaque
        frame.setContentPane(newContentPane);

        //Display the window.
        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                RShowGUI();
            }
        });
    }
}

0
Comment
Question by:Rebnick
  • 6
  • 5
  • 4
15 Comments
 
LVL 16

Expert Comment

by:suprapto45
ID: 18797699
The error occurred at

              JComboBox cb = (JComboBox)e.getSource();
              String petName = (String)cb.getSelectedItem();

First, you can't cast the String from e.getSource() to JComboBox.

Well, if you would like to access petName, I suggest you to put your petList JComboBox on the class level and access it using
              String petName = petList.getSelectedItem().toString();
0
 

Author Comment

by:Rebnick
ID: 18797711
I am not sure I follow what you are saying. I know that it looks strange called PetName I started with an example and have not changed the names as of yet.  The combo box comes up but I don't now how to refer to the position to get my position in my termArray and rateArray. Any help would be greatly appreciated. I am new at this.
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 18797727
Okay,

Not a problem. At least that you are putting some efforts to do it.

Firstly, add the JComboBox below the JScrollPane.

       JScrollPane scroll = new JScrollPane(displayArea);
       JComboBox petList = new JComboBox();

then modify your

        JComboBox petList = new JComboBox(petStrings);
        petList.setSelectedIndex(4);

to

        petList = new JComboBox(petStrings);
        petList.setSelectedIndex(4);

Then in your ActionListener, modifuy your codes to
              //JComboBox cb = (JComboBox) e.getSource();
              String petName = petList.getSelectedItem().toString();
            System.out.println(petName);

You will see that your petName will be displayed.

David


0
 

Author Comment

by:Rebnick
ID: 18797732
Thanks I will give it a try and let you know. I appreciate the help.
0
 

Author Comment

by:Rebnick
ID: 18802902
I still can not get my array's to work with the combo box what am I doing wrong???


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

import javax.swing.text.*;
import java.util.Locale;
import javax.swing.JScrollPane;
import javax.swing.JOptionPane;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.text.*;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;

import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;


import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;

import java.text.*;



public class POS407_W3_RMR extends JPanel
                          implements ActionListener {


    //creating variables

     public double monthly_interest;
     public double monthly_payment;
       public double number_payments;
       public double new_principle;
       public double m_principle;
       public double cm_interest;
       public double mortint;
       double new_balance;

     //Create Labels
       private JLabel ownerLabel;
       private JLabel assignmentLabel;
       private JLabel separatorLabel;
       private JLabel termLabel;
       private JLabel principleLabel;
       private JLabel yearLabel;
       private JLabel monthlyLabel;
       private JLabel fillerLabel;

       String[] yearAPRStrings = { "7 years at 5.35", "4years", "30years", "40years", "50years" };
       int termArray [] = {7,4,30,40,50};
     double rateArray [] = {5.35,7.57,5.75,5.65,5.45};



       //Value for Fields
       double principal;
       double rate;
       int term;
       int pos;


       //Create the text fields and set them up.
       JTextField principalField = new JTextField("100000");
       JTextField termField = new JTextField("7");
       JTextField rateField = new JTextField(".0535");
       JTextField paymentField = new JTextField(10);


     //Create Buttons
       private JButton calculateButton;
       private JButton exitButton;



       //Strings for the labels
       private static String ownerString = "Name : Rebecca Ragucci";
       private static String assignmentString = "Assignment : POS407 Workshop 3";
       private static String separatorString  = "--------------------------------------------------";


     //Create JTextArea and JScrollPane
       JTextArea displayArea = new JTextArea(10,48);
       JScrollPane scroll = new JScrollPane(displayArea);
       JComboBox cb_yearAPR = new JComboBox(yearAPRStrings);



    public POS407_W3_RMR() {
        super(new BorderLayout());


        //Define Panels
            JPanel headingPane = new JPanel(new GridLayout(0,1));
            JPanel termPane = new JPanel(new GridLayout(0,1));
            JPanel principlePane = new JPanel(new GridLayout(0,1));
            JPanel textPane = new JPanel(new GridLayout(0,2));
            JPanel comboPane = new JPanel(new GridLayout(0,1));

            //Define Labels
            ownerLabel = new JLabel(ownerString);
            assignmentLabel = new JLabel(assignmentString);
            separatorLabel = new JLabel(separatorString);
            principleLabel = new JLabel("Principle: ");
            monthlyLabel = new JLabel("Monthly Payment:$ ");
            fillerLabel = new JLabel("Year / APR%");

            //Define Heading
          headingPane.add(ownerLabel);
        headingPane.add(assignmentLabel);
            headingPane.add(separatorLabel);


        //New JPanel
            JPanel actionPane = new JPanel(new GridLayout(0,1));

        //Define Buttons
          calculateButton = new JButton("Calculate");
            exitButton = new JButton("Exit");


        //Create the combo box, select the item at index 4.
        //JComboBox cb_yearAPR = new JComboBox(yearAPRStrings);
        cb_yearAPR.setSelectedIndex(4);
        cb_yearAPR.addActionListener(this);

        //Define Text Pane
        textPane.add(principleLabel);
            textPane.add(principalField);
            textPane.add(fillerLabel);
            textPane.add(cb_yearAPR);
            textPane.add(monthlyLabel);
            textPane.add(paymentField);
            textPane.add(calculateButton);
            textPane.add(exitButton);


            calculateButton.addActionListener(this);
            exitButton.addActionListener(this);


        //Lay out
        setBorder(BorderFactory.createEmptyBorder(10,10,10,10));

            add(headingPane, BorderLayout.PAGE_START);
            add(actionPane,BorderLayout.PAGE_END);
            add(textPane,BorderLayout.CENTER);

        //setting up scroll bars
            scroll.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
            actionPane.add(scroll);

    }



    /** Listens to the combo box. */
    public void actionPerformed(ActionEvent e)

    {
            Object source = e.getSource();
            JComboBox cb = (JComboBox)e.getSource();
            if (source == cb){
                  int indexcb = cb.getSelectedIndex();
                  //System.out.println("Selected index is" + indexcb + "\n");
                  term = termArray[indexcb];
            rate = rateArray[indexcb];


                    }

             DecimalFormat pTwo = new DecimalFormat("0.00");


             if (source == calculateButton)
             {
                principal = 100000.00;
                term = 7;
                  rate = .0535;
                        number_payments = (term * 12);

                        rate = (rate / 100);

                        monthly_interest = (rate  / 12);

                        monthly_payment = (principal * monthly_interest) / (1 - Math.pow(1/ (1 + monthly_interest), number_payments));

                        paymentField.setText(pTwo.format(monthly_payment));



            new_principle = principal;
            String titles = "Month\t Principal\t\tInterest\t\tBalance\n";
                  displayArea.setText(titles);

            for(int counter = 0; counter <number_payments; counter++)
                  {
                        //Scroll Area


                        cm_interest = new_principle * monthly_interest;    //current monthly interest

                    m_principle= monthly_payment - cm_interest ;
                                                                  /* this is your monthly payment minus your monthly interest,
                                                                                       so it is the amount of principal you pay for that month */

                        new_balance = new_principle - m_principle;
                                                                  /*this is the new balance of your principal of your loan*/

                        new_principle = new_balance;

                        mortint = cm_interest * 100;

                //displayArea.setCaretPosition(0);
                        displayArea.append((counter + 1) + ")\t" + pTwo.format(m_principle) + "\t\t" + pTwo.format(mortint)+ "\t\t" + pTwo.format(new_balance) + "\n");

                  }



            }
                  else if (source == exitButton)
                  {
                     System.exit(0);
            }

    }


    private static void RShowGUI() {
        //Create and set up the window.
        JFrame frame = new JFrame("Rebecca'a Mortgage Calc");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //Create and set up the content pane.
        JComponent newContentPane = new POS407_W3_RMR();
        newContentPane.setOpaque(true); //content panes must be opaque
        frame.setContentPane(newContentPane);

        //Display the window.
        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                RShowGUI();
            }
        });
    }
}

0
 
LVL 16

Expert Comment

by:suprapto45
ID: 18805010
You are actually repeating the SAME problem again. You should have it as below.

    /** Listens to the combo box. */
    public void actionPerformed(ActionEvent e)

    {
            Object source = e.getSource();
            //JComboBox cb = (JComboBox)e.getSource();
            if (source == cb_yearAPR){
                  int indexcb = cb_yearAPR.getSelectedIndex();
                  //System.out.println("Selected index is" + indexcb + "\n");
                  term = termArray[indexcb];
            rate = rateArray[indexcb];


                    }

David
0
 

Author Comment

by:Rebnick
ID: 18805166
Okay I figured out my problem with the combo box however in the portion with the combo listener I get my position and then get my rate and term however when I display the term it gives me 5.5E-4? Why would that be?

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

import javax.swing.text.*;
import java.util.Locale;
import javax.swing.JScrollPane;
import javax.swing.JOptionPane;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.text.*;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;

import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;


import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;

import java.text.*;



public class POS407_W3_RMR extends JPanel
                          implements ActionListener {


    //creating variables

     public double monthly_interest;
     public double monthly_payment;
       public double number_payments;
       public double new_principle;
       public double m_principle;
       public double cm_interest;
       public double mortint;
       double new_balance;
       int iCounter = 0;

     //Create Labels
       private JLabel ownerLabel;
       private JLabel assignmentLabel;
       private JLabel separatorLabel;
       private JLabel termLabel;
       private JLabel principleLabel;
       private JLabel yearLabel;
       private JLabel monthlyLabel;
       private JLabel fillerLabel;
       String string_percent = "###.###%";


       int [] termArray = {7,15,30};
     double [] rateArray = {.0535,.0550,.0575};

     //formats
     NumberFormat nPercent = new DecimalFormat(string_percent);
     DecimalFormat pTwo = new DecimalFormat("0.00");



       //Value for Fields
       public double principal;
       public double rate;
       public int term;
       public int pos;


       //Create the text fields and set them up.
       JTextField principalField = new JTextField(null);
       //JTextField termField = new JTextField("7");
       //JTextField rateField = new JTextField(".0535");
       JTextField paymentField = new JTextField(10);


     //Create Buttons
       private JButton calculateButton;
       private JButton exitButton;



       //Strings for the labels
       private static String ownerString = "Name : Rebecca Ragucci";
       private static String assignmentString = "Assignment : POS407 Workshop 3";
       private static String separatorString  = "--------------------------------------------------";


     //Create JTextArea and JScrollPane
       JTextArea displayArea = new JTextArea(10,48);
       JScrollPane scroll = new JScrollPane(displayArea);
       JComboBox cb_yearAPR = new JComboBox();



    public POS407_W3_RMR() {
        super(new BorderLayout());


        //Define Panels
            JPanel headingPane = new JPanel(new GridLayout(0,1));
            JPanel termPane = new JPanel(new GridLayout(0,1));
            JPanel principlePane = new JPanel(new GridLayout(0,1));
            JPanel textPane = new JPanel(new GridLayout(0,2));
            JPanel comboPane = new JPanel(new GridLayout(0,1));

            //Define Labels
            ownerLabel = new JLabel(ownerString);
            assignmentLabel = new JLabel(assignmentString);
            separatorLabel = new JLabel(separatorString);
            principleLabel = new JLabel("Principle: ");
            monthlyLabel = new JLabel("Monthly Payment:$ ");
            fillerLabel = new JLabel("Year / APR%");

            //Setup Combo box
            for(iCounter=0;iCounter <=2;iCounter++)
            {
                  cb_yearAPR.addItem(termArray[iCounter] + "years - " + nPercent.format(rateArray[iCounter]));
            }

            //Define Heading
          headingPane.add(ownerLabel);
        headingPane.add(assignmentLabel);
            headingPane.add(separatorLabel);


        //New JPanel
            JPanel actionPane = new JPanel(new GridLayout(0,1));

        //Define Buttons
          calculateButton = new JButton("Calculate");
            exitButton = new JButton("Exit");


        //Create the combo box, select the item at index 4.
        //JComboBox cb_yearAPR = new JComboBox(yearAPRStrings);
        //cb_yearAPR.setSelectedIndex(2);


        //Define Text Pane
        textPane.add(principleLabel);
            textPane.add(principalField);
            textPane.add(fillerLabel);
            textPane.add(cb_yearAPR);
            textPane.add(monthlyLabel);
            textPane.add(paymentField);
            textPane.add(calculateButton);
            textPane.add(exitButton);

        //Listeners
            calculateButton.addActionListener(this);
            exitButton.addActionListener(this);
            cb_yearAPR.addActionListener(this);


        //Lay out
        setBorder(BorderFactory.createEmptyBorder(10,10,10,10));

            add(headingPane, BorderLayout.PAGE_START);
            add(actionPane,BorderLayout.PAGE_END);
            add(textPane,BorderLayout.CENTER);

        //setting up scroll bars
            scroll.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
            actionPane.add(scroll);

    }



    /** Listens to the combo box. */
    public void actionPerformed(ActionEvent e)

    {
            Object source = e.getSource();

         if(source == cb_yearAPR)
         {
                   int cbs = cb_yearAPR.getSelectedIndex();
                   term = termArray[cbs] * 12;
                   rate = rateArray[cbs] /100;
                   System.out.println("rate" + rate);

              }



             if (source == calculateButton)
             {

                        monthly_interest = (rate  / 12);

                        monthly_payment = (principal * monthly_interest) / (1 - Math.pow(1/ (1 + monthly_interest), number_payments));

                        paymentField.setText(pTwo.format(rate));



            new_principle = principal;
            String titles = "Month\t Principal\t\tInterest\t\tBalance\n";
                  displayArea.setText(titles);

            for(int counter = 0; counter <number_payments; counter++)
                  {
                        //Scroll Area


                        cm_interest = new_principle * monthly_interest;    //current monthly interest

                    m_principle= monthly_payment - cm_interest ;
                                                                  /* this is your monthly payment minus your monthly interest,
                                                                                       so it is the amount of principal you pay for that month */

                        new_balance = new_principle - m_principle;
                                                                  /*this is the new balance of your principal of your loan*/

                        new_principle = new_balance;

                        mortint = cm_interest * 100;

                //displayArea.setCaretPosition(0);
                        displayArea.append((counter + 1) + ")\t" + pTwo.format(m_principle) + "\t\t" + pTwo.format(mortint)+ "\t\t" + pTwo.format(new_balance) + "\n");

                  }



            }
                  else if (source == exitButton)
                  {
                     System.exit(0);
            }

    }


    private static void RShowGUI() {
        //Create and set up the window.
        JFrame frame = new JFrame("Rebecca'a Mortgage Calc");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //Create and set up the content pane.
        JComponent newContentPane = new POS407_W3_RMR();
        newContentPane.setOpaque(true); //content panes must be opaque
        frame.setContentPane(newContentPane);

        //Display the window.
        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                RShowGUI();
            }
        });
    }
}

0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 30

Accepted Solution

by:
mayankeagle earned 500 total points
ID: 18805451
>> however when I display the term it gives me 5.5E-4

You want to display it in another format or is it the value which is incorrect?
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 18805468
Is that the comment you want to accept?
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 18805533
Yep,

I am also confused on why you accept that comment?

Thanks.
David
0
 

Author Comment

by:Rebnick
ID: 18805568
This is the first time I ever got that question was not sure how to answer it. What does it mean?
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 18805589
I meant that is the value being displayed incorrect or is it that you want to display it in another format?
0
 

Author Comment

by:Rebnick
ID: 18805625
Sorry should have made that clear I got the question do I want to accept  the comment I did not know how to answer it. Sorry for the confusion. My program is complete I thank you all for the help this site has been very helpful.
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 18805695
I've asked the page editor Venabili to re open this question so that you can accept David's comment as answer.

>> it gives me 5.5E-4? Why would that be?

is there something unanswered?
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 18805706
>>"I've asked the page editor Venabili to re open this question so that you can accept David's comment as answer."
Thanks.

>> it gives me 5.5E-4? Why would that be?
Rebnick, please do not hesitate to let us know if this is still problem as we will definitely help you to solve this.

PS. Sorry for any delay. I am quite busy at the moment.

David
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now