Need help with the text output here... kinda a newbie..

Alright the problem I am having is with the output of this program. It does not appear to calculate the mortgage formula correctly and outputs some other data that does not make any sense. here is the code. Any help on this matter would be great!!
import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Calculator 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 Calculator() {
  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(2);
textFieldRate.setColumns(2);
Container contentPane = getContentPane();
contentPane.setLayout(new FlowLayout());
//Lets 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) {
  Calculator frame = new Calculator();
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 );
   double result = (amount*((rate/12)/(1-Math.pow((1+(rate/12)),-(term*12)))));
   textFieldResult.setText(Double.toString(result));
public void actionPerformed(ActionEvent event) {
  System.out.println("Action Button");
  String command = event.getActionCommand();
  if (command == "Calculate") {
      setResultValue();
}

Alright the problem I am having is with the output of
this program. It does not appear to calculate the
mortgage formula correctly and outputs some other
data that does not make any sense. here is the code.
Any help on this matter would be great!!First of all, what is the mortgage formula?

Similar Messages

  • I need help with my text tone and I have ring tone. no text tone for the 4s.

    I need help with my text tone. I have ring tone no text tone. I have a 4s.

        Hi Sarar2333!  Let's get your text tones working again!
    Here's a link with instructions how to enable and change your alert sounds for your text/notification settings on your iPhone 4S: http://vz.to/1stiF8a.  You can ensure text tones are enabled by selecting a tone in the "Text Tone" setting.  Let me know how that works out for you.  Thanks!
    AnthonyTa_VZW
    Follow us on Twitter @VZWSupport

  • I need help with the conditional build tag option RoboHelp 10

    I need help with the conditional build tag option. I want to apply CBT to content in a topic. I looked at the Help topics and believed that I applied the feature correctly. Howver, it is not working as desired. In the 2nd sentence below I want the text highlighted in blue to only appear for the printed output and the text printed in purple to only appear for the .htm /online output. Please help.
    There are common tasks used to manage the folders in the Navigator and the folders
    in the BBS Folders Viewer Grid. For more information on these common tasks see Help
    and Support in Success Enterprise. click the links below.

    Hi there
    Using tagging is a two part process.
    Part One
    You create and apply the tags to the information you wish to control.
    Part Two
    You create a Build Expression that is used when you generate your output. The Build Expression typically reads something like: NOT Tag1 (or whatever your tag name is)
    Then when you generate and use the Build Expression, the information tagged is not included in the build.
    Cheers... Rick

  • I need help with the photo stream. Everytime I try to open it on my PC it says photo stream is unable and I have tried everuthing to enable it but it doesn't work. Any help, please?

    I need help with the photo stream. Everytime I try to open it on my PC it says photo stream is unable and I have tried everuthing to enable it but it doesn't work. Any help, please?

    Freezing, or crashing?
    ID on the Mac can produce reports that may (or may not) prove helpful in diagnosing the problem. I suspect this is something not directly related to InDesign, and maybe not to any of the Adobe apps directly since you seem to be having a problem in more than one. That often inidcates a problem at the system level.
    Nevertheless, it won't hurt to try to gather the reports. You'll find driections for how to generate them, and to post them on Pastebin.com (then put a link to them here) so we can see what's going on at Adobe Forums: InDesign CS5.5 Not Responding
    Do you happen to run a font manager? If so, which one, and waht version?

  • I need help with the Web Application Certificate

    Greets,
    The title says it all really. I need help with the Web Application Certificate.
    I've followed the instructions from here:
    https://www.novell.com/documentation....html#b13qz9rn
    I can get as far as item 3.c
    3. Getting Your Certificate Officially Signed
    C. Select the self-signed certificate, then click File > Certification Request > Import CA Reply.
    I can get the certificate in to the Filr appliance but from there I'm stuck.
    Any help much appreciated.

    Originally Posted by bentinker
    Greets,
    The title says it all really. I need help with the Web Application Certificate.
    I've followed the instructions from here:
    https://www.novell.com/documentation....html#b13qz9rn
    I can get as far as item 3.c
    ok when you have you self signed certificate and you requested an official certificate with the corresponding CSR then you just need to go back to the digital certificates console. To import the official certificate, select the self signed certificate, then click File > Certification Request > Import CA Reply. Then a new windows pops out to select the certificate from your trusted authority from your local hard disk. Find the file (.cer worked for me) and click ok. As soon as you do this in the digital certificates console the self signed certificate will change the information that now it is officially signed. Look at the second column and you should see the name of your trusted authority under "issue from"
    I personally had a lot of issues across all platforms. Especially Firefox and Chrome for android. Needed to pack all the root cert, intermediate cert and signed cert into one file and import as CA reply. Not even sure if this is correct now. But at least it works.

  • I still need help with the Dictionary for my Nokia...

    I still need help with the Dictionary for my Nokia 6680...
    Here's the error message I get when trying to open dictionary...
    "Dictionary word information missing. Install word database."
    Can someone please provide me a link the where I could download this dictionary for free?
    Thanks!
    DON'T HIT KIDS... THEY HAVE GUNS NOW.

    oops, im sorry, i didnt realised i've already submitted it
    DON'T HIT KIDS... THEY HAVE GUNS NOW.

  • Need help with the Vibrance adjustment in Photoshop CC 2014.

    Need help with the Vibrance adjustment in Photoshop CC 2014.
    Anytime I select Vibrance to adjust the color of an image. The whole image turns Pink in the highlights when the slider is moved from "0" to - or + in value.  Can the Vibrance tool be reset to prevent this from happening? When this happens I cn not make adjustments...just turns Pink.
    Thanks,
    GD

    Thank you for your reply. 
    Yes, that does reset to “0” and the Pink does disappear.
    But as soon as I move the slider +1 or -1 or higher the image turns Pink in all of the highlights again, rather than adjusting the overall color.
    GD
    Guy Diehl  web: www.guydiehl.com | email: [email protected]

  • I need help with the iPad Remote app to connect to apple TV 2

    I need help with the iPad Remote app to connect to apple TV 2 I have the app already on my ipad and when I open it only shows my itunes library and not the small black Apple TV 2 icon! How do i fix this and i know it's something 

    Get the manual at http://manuals.info.apple.com/en_US/AppleTV_SetupGuide.pdf
     Cheers, Tom

  • Need help with the session state value items.

    I need help with the session state value items.
    Trigger is created (on After delete, insert action) on table A.
    When insert in table B at least one row, then trigger update value to 'Y'
    in table A.
    When delete all rows from a table B,, then trigger update value to 'N'
    in table A.
    In detail report changes are visible, but the trigger replacement value is not set in session value.
    How can I implement this?

    You'll have to create a process which runs after your database update process that does a query and loads the result into your page item.
    For example
    SELECT YN_COLUMN
    FROM My_TABLE
    INTO My_Page_Item
    WHERE Key_value = My_Page_Item_Holding_Key_ValueThe DML process will only return key values after updating, such as an ID primary key updated by a sequence in a trigger.
    If the value is showing in a report, make sure the report refreshes on reload of the page.
    Edited by: Bob37 on Dec 6, 2011 10:36 AM

  • Need Help with the Clone Tool

    I need help with the clone tool, in that when I clone (let's say grass as example),  the new cloned area does NOT come out as sharp as the area selected.  It comes out much softer and somewhat blurred.  I have the opacity and flow both set at 100%.  This is very frustrating since I can not get a true clone.

    what "tip" do you have selected? where are you sampling from ( found in top option bar) ALSO make sure MODE is normal
    http://helpx.adobe.com/photoshop/using/retouching-repairing-images.html
    -janelle

  • I need help with the Quote applet.

    Hey all,
    I need help with the Quote applet. I downloaded it and encoded it in the following html code:
    <html>
    <head>
    <title>Part 2</title>
    </head>
    <body>
    <applet      codebase="/demo/quote/classes" code="/demo/quote/JavaQuote.class"
    width="300" height="125" >
    <param      name="bgcolor"      value="ffffff">
    <param      name="bheight"      value="10">
    <param      name="bwidth"      value="10">
    <param      name="delay"      value="1000">
    <param      name="fontname"      value="TimesRoman">
    <param      name="fontsize"      value="14">
    <param      name="link"      value="http://java.sun.com/events/jibe/index.html">
    <param      name="number"      value="3">
    <param      name="quote0"      value="Living next to you is in some ways like sleeping with an elephant. No matter how friendly and even-tempered is the beast, one is affected by every twitch and grunt.|- Pierre Elliot Trudeau|000000|ffffff|7">
    <param      name="quote1"      value="Simplicity is key. Our customers need no special technology to enjoy our services. Because of Java, just about the entire world can come to PlayStar.|- PlayStar Corporation|000000|ffffff|7">
    <param      name="quote2"      value="The ubiquity of the Internet is virtually wasted without a platform which allows applications to utilize the reach of Internet to write ubiquitous applications! That's where Java comes into the picture for us.|- NetAccent|000000|ffffff|7">
    <param      name="space"      value="20">
    </applet>
    </body>
    </html>When I previewed it in Netscape Navigator, a box with a red X appeared, and this appeared in the console when I opened it:
    load: class /demo/quote/JavaQuote.class not found.
    java.lang.ClassNotFoundException: .demo.quote.JavaQuote.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: \demo\quote\JavaQuote\class.class (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    Exception in thread "Thread-4" java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletException(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)What went wrong? and how can I make it run correct?
    Thanks,
    Nathan Pinno

    JavaQuote.class is not where your HTML says it is. That is at the relative URL "/demo/quote/".

  • I need Help with the dynamic link feature in CS3

    Hi I was wondering if anyone could help me with an issue I am having? I have the adobe cs3 master collection. Having watched tutorials on the dynamic link feature my version seems not to have the same options as those I have viewed. I wish to send my premiere video creation to encore using dynamic link, however when I click "file" and then "adobe dynamic link" the only options available are about "adobe after effects". I can export to encore however I am only alloowed to export one premiere sequence to one new encore file, I cannot create an encore file and import several premiere sequence into the same encore project. That means currently I can only have an encore creation with one premiere sequence in it, and I have no adobe dynamic link. Any help anyone could offer would be greatly appreciated.

    Thanks very much for that guys but my premiere media encoder only lets me export as: MPEG1, MPEG1-VCD, MPEG2, MPEG2 blu-ray, MPEG2-DVD, MPEG2-SVCD, H.264, H.264 blu-ray, Adobe Flash Video, Quicktime, Real Media, Windows Media. Are any of these formats DV AVI?
    Am I to export my videos direct to encore or save them elsewhere (e.g desktop). It seems that I cannot export sequences from different premiere projects to the same encore project.
    Sorry if any of these questions seem obvious, I am just new to premiere and keen to do things right from the off.
    Many thanks again guys.
    Date: Tue, 24 Nov 2009 19:32:47 -0700
    From: [email protected]
    To: [email protected]
    Subject: I need Help with the dynamic link feature in CS3
    Harm is correct.  For SD DVD, exporting as a DV AVI file from Pr will give you good results.  Encore's Automatic Transcoding will give you maximum quality for the available disc space.
    -Jeff
    >

  • HT4528 Hi  I need help with the volume on my phone  even on speaker i can barely hear who I am speaking with

    Hi I need help with the volume on my phone, even on speaker I can barely hear who I am speaking with . How do I make it louder /

    Hi there,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    iPhone: Can't hear through the receiver or speakers
    http://support.apple.com/kb/ts1630
    -Griff W.

  • I am needing help with the final steps in restoring my iPod Touch 5

    I need help with the final steps in restoring my iPod

    I was told that the iPod would automatically go to restore mode when connected to wifi. It did not do that

  • HT5312 i need help with the security questions is there some way to get you to remind me what they were from e-mail or other wise

    I need help with the security Questions is there some way to get you to remember them by e-mail of other wise

    Read the HT5312 page that you posted from, it has instructions for how to reset them i.e. if you have a rescue email address set up on your account then steps 1 to 5 half-way down that page should give you a reset link.
    If you don't have a rescue email address then you will need to contact iTunes Support / Apple in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 page that you posted from to add a rescue email address for potential future use

Maybe you are looking for

  • Airport express disappears from list of multiple speakers

    Since upgrading Mac OS X (to 10.5.7) and iTunes (to 8.2) my airport express remote speakers have not been working as reliably: The remote speakers tend to disappear from the "multiple speakers" list when they haven't been used for a few minutes. This

  • How to restart Time Machine?

    If I eject my external drive TM, is there a way to reinstall it from within Mac? What I have to do now is to either restart the computer or, completely unplug the hard drive and plug it back in. Thanks

  • PS CS5 on my Macbook

    I just got a Macbook Pro and downloaded CS5 (the version I already own on my mac desktop) Everything seemed great until I tried to open RAW files from my camera. It says it does not recognize the format of the files.  I updated everything and tried a

  • OM: Positions date Error

    Hi Friends, I have a issue, while creating positions in PPOC_OLD the date period BEGDA & ENDDA assign as 01.01.2009 to 31.12.9999 but the system is creating as 07.09.1995 in Object period. Awaiting your reply Regards Praveen

  • Kodo doing tablescan "select jdoclass from table "

    Kodo is doing the following query on a table I am executing a query on, the JDOCLASS field is not indexed (should it be ? It is not very unique, only 3 distinct records out of 800,000). This tablescan takes about 8 minutes to complete..... any sugges