Elusive error

Can not find/correct error

  • (2 Pages)
  • +
  • 1
  • 2

21 Replies - 1258 Views - Last Post: 18 January 2010 - 09:53 PM Rate Topic: -----

#1 shorty64  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 18-January 10

Elusive error

Posted 18 January 2010 - 01:24 PM

import java.text.NumberFormat;

	public class Mgcalcac	// a single-line comment
   {
	   public static void main(String[] args)
	  {
// declaration of mortgage variables
	int Counter;
	int Principle;
	double Rate;
	double MonthlyPayments;
	String Title, Programmer, ProgramName;
//-------------------------------------------------------setting values

	Principle = 200000;
	Title =(" McBride Financial Services");
	ProgramName =("Mortgage Calculator");
	Programmer =("by Robert Springer");
//--------------------------------------------------------------Defineing Arrays

	double IntRate [] = {5.35, 5.5, 5.75};
	int TermLength [] = {7, 15, 40};

//----------------------------------------------Output

	System.out.println("Title" + " Programmer ");
	System.out.println("Calculated loan amount for all loans:");
	System.out.println(NumberFormat.getCurrencyInstance().format(Principle) + "\n");

	System.out.println("Interest Rate:\t" + "Term Length" + "Monthly Payments:\n");

//----------------------------------------Start "for" loop
	for (int counter = 0; counter < TermLength.length; counter += 1)

				{

//---------------------------------------Calculate monthly payments for three loan types


	Rate = IntRate[counter] * .010;
	MonthlyPayments = ((Rate / 12) * Principle) / (1- (Math.pow (1+ (Rate / 12))
	+(Term[ counter ] + " Years\t\t")
	+ NumberFormat.getCurrencyInstance().format(MonthlyPayments)));

 				}
	}
}



Mod Edit:
Added in code tags. When posting code please use tags like below.
:code:

Is This A Good Question/Topic? 0
  • +

Replies To: Elusive error

#2 TriggaMike  Icon User is offline

  • Using up all your 1's and 0's
  • member icon

Reputation: 85
  • View blog
  • Posts: 1,103
  • Joined: 26-September 08

Re: Elusive error

Posted 18 January 2010 - 01:36 PM

So... let's take a look here:

Title =(" McBride Financial Services");
    ProgramName =("Mortgage Calculator");
    Programmer =("by Robert Springer");


and here

MonthlyPayments = ((Rate / 12) * Principle) / (1- (Math.pow (1+ (Rate / 12))
    +(Term[ counter ] + " Years\t\t")
    + NumberFormat.getCurrencyInstance().format(MonthlyPayments)));


Since you didn't post an error, I don't know what you're getting. Neither of those should even compile. Monthly payments is a double, and you have a string in there? With Tabs? and then you format something? What exactly are you doing here? I mean, I understand what you're supposed to be doing, but those two pieces are very broken. What exactly is your problem? What debugging steps have you tried?
Was This Post Helpful? 0
  • +
  • -

#3 shorty64  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 18-January 10

Re: Elusive error

Posted 18 January 2010 - 02:01 PM

View PostTriggaMike, on 18 Jan, 2010 - 12:36 PM, said:

So... let's take a look here:

Title =(" McBride Financial Services");
    ProgramName =("Mortgage Calculator");
    Programmer =("by Robert Springer");


and here

MonthlyPayments = ((Rate / 12) * Principle) / (1- (Math.pow (1+ (Rate / 12))
    +(Term[ counter ] + " Years\t\t")
    + NumberFormat.getCurrencyInstance().format(MonthlyPayments)));


Since you didn't post an error, I don't know what you're getting. Neither of those should even compile. Monthly payments is a double, and you have a string in there? With Tabs? and then you format something? What exactly are you doing here? I mean, I understand what you're supposed to be doing, but those two pieces are very broken. What exactly is your problem? What debugging steps have you tried?


May be I should back up here. I had been using JDK6 and tried to load eclipse to have a better forum to develope my code. I can not get Eclipse to start. I believe there is a pth problem but Ican not fix it. ALso, I tried to use netbeans...but that is out. I downloaded a text editor, wordpad? and it would compile my code and it returned an error of " line 32 ")" .....
So now I am in a state of no compiler or editor and really need help to get that in line.

Are you game to help me get my tools on line? Maybe then I can get my coding in line and move forward...
Was This Post Helpful? 0
  • +
  • -

#4 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: Elusive error

Posted 18 January 2010 - 02:06 PM

What do you mean you cannot get Eclipse to start? Are you sure you have the prerequisites (correctly) installed? The JDK/JRE?

This post has been edited by erik.price: 18 January 2010 - 02:06 PM

Was This Post Helpful? 0
  • +
  • -

#5 TriggaMike  Icon User is offline

  • Using up all your 1's and 0's
  • member icon

Reputation: 85
  • View blog
  • Posts: 1,103
  • Joined: 26-September 08

Re: Elusive error

Posted 18 January 2010 - 02:13 PM

Reinstall your JDK and then take a look at those two sections.

Wrapping a string declaration with () won't work, they only need "" for strings.

Also you need to rework that whole whole second section I quoted.
Was This Post Helpful? 0
  • +
  • -

#6 shorty64  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 18-January 10

Re: Elusive error

Posted 18 January 2010 - 02:48 PM

View Posterik.price, on 18 Jan, 2010 - 01:06 PM, said:

What do you mean you cannot get Eclipse to start? Are you sure you have the prerequisites (correctly) installed? The JDK/JRE?


Yes, I have gone back through the online tutorials and checked my installation processes.

JDK6- updated to . 17 release
Eclipse downloaded and installed new folder under C:\
JRE installed 1.4.2
System path for java inplace looking at JDK6.2.17

IHere is the eclipse error that pops up when the EXE is initiated:

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#7 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: Elusive error

Posted 18 January 2010 - 02:58 PM

Do somthing quickly. Bring up command prompt and firstly type in

Quote

java -version

And print out the results of that.

Then after this, just type in

Quote

set

And print out the result of this.
Was This Post Helpful? 0
  • +
  • -

#8 shorty64  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 18-January 10

Re: Elusive error

Posted 18 January 2010 - 03:25 PM

View Postnick2price, on 18 Jan, 2010 - 01:58 PM, said:

Do somthing quickly. Bring up command prompt and firstly type in

Quote

java -version

And print out the results of that.

Then after this, just type in

Quote

set

And print out the result of this.



Here is the results:

#1
Microsoft Windows XP [Version 5.1.2600]
© Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>java -version
java version "1.6.0_17"
Java™ SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot™ Client VM (build 14.3-b01, mixed mode, sharing)

C:\Documents and Settings\Administrator>

#2
Microsoft Windows XP [Version 5.1.2600]
© Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>java -version
java version "1.6.0_17"
Java™ SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot™ Client VM (build 14.3-b01, mixed mode, sharing)

C:\Documents and Settings\Administrator>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\Administrator\Application Data
CLASSPATH=.;C:\Program Files\Java\jre6\lib\ext\
CLIENTNAME=Console
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=ADMIN1
ComSpec=C:\WINDOWS\system32\cmd.exe
eclipse=.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\Administrator
LOGONSERVER=\\ADMIN1
MOZ_PLUGIN_PATH=C:\Program Files\Virtools\3D Life Player\
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program File
s\JavaFX\javafx-sdk1.2\bin;C:\Program Files\JavaFX\javafx-sdk1.2\emulator\bin;C:
\PROGRA~1\GRADKE~1\DBSIGN~1\lib;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System
32\Wbem;"C:\Program Files\Zone Labs\ZoneAlarm\MailFrontier";C:\Program Files\Qui
ckTime\QTSystem\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Com
mon Files\Microsoft Shared\Windows Live;C:\Program Files\Java\jdk1.6.0_17\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 9 Stepping 5, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0905
ProgramFiles=C:\Program Files
PROMPT=$P$G
QTJAVA=C:\Program Files\Java\jre6\lib\ext\QTJava.zip
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp
tvdumpflags=8
USERDOMAIN=ADMIN1
USERNAME=Administrator
USERPROFILE=C:\Documents and Settings\Administrator
windir=C:\WINDOWS

C:\Documents and Settings\Administrator>
Was This Post Helpful? 0
  • +
  • -

#9 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: Elusive error

Posted 18 January 2010 - 03:45 PM

Spanning through that, it pretty much looks ok. You may want to try a different version of eclipse. Try the latest version of eclipse galileo
Was This Post Helpful? 0
  • +
  • -

#10 shorty64  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 18-January 10

Re: Elusive error

Posted 18 January 2010 - 03:51 PM

View Postnick2price, on 18 Jan, 2010 - 02:45 PM, said:

Spanning through that, it pretty much looks ok. You may want to try a different version of eclipse. Try the latest version of eclipse galileo




That is what I downloaded and installed. Eclipse Gallileio
Was This Post Helpful? 0
  • +
  • -

#11 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: Elusive error

Posted 18 January 2010 - 03:56 PM

you dont install eclipse. Go to their website, and see what they have for java code. Download one other than galileo then. Try eclipse classic. Just want to see if its an ide issue your having. When you download it, dont move the folder. Just open it and double click on the eclipse symbal to run the program.
Was This Post Helpful? 0
  • +
  • -

#12 shorty64  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 18-January 10

Re: Elusive error

Posted 18 January 2010 - 03:59 PM

View Postnick2price, on 18 Jan, 2010 - 02:56 PM, said:

you dont install eclipse. Go to their website, and see what they have for java code. Download one other than galileo then. Try eclipse classic. Just want to see if its an ide issue your having. When you download it, dont move the folder. Just open it and double click on the eclipse symbal to run the program.


Should I uninstall the current eclipse? I have read that in the tutorial, but it maily pertains to the location of the folder.
Was This Post Helpful? 0
  • +
  • -

#13 TriggaMike  Icon User is offline

  • Using up all your 1's and 0's
  • member icon

Reputation: 85
  • View blog
  • Posts: 1,103
  • Joined: 26-September 08

Re: Elusive error

Posted 18 January 2010 - 04:12 PM

Eclipse is a Java program and it doesn't touch your Registry. It doesn't install. You should delete it just for the sake of Hard Drive Space (Eclipse isn't exactly a small program).
Was This Post Helpful? 0
  • +
  • -

#14 shorty64  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 18-January 10

Re: Elusive error

Posted 18 January 2010 - 04:36 PM

View PostTriggaMike, on 18 Jan, 2010 - 03:12 PM, said:

Eclipse is a Java program and it doesn't touch your Registry. It doesn't install. You should delete it just for the sake of Hard Drive Space (Eclipse isn't exactly a small program).



I am just about ready to unzip the file. I have done this process many times before this and the same result has happend. This time, I am downloading eclipse classic I will unzip and let it roll out in the suggested file/folder. Then click on the icon exe and see what happends....

Sitting at 70% right now......be a few minutes.....
Was This Post Helpful? 0
  • +
  • -

#15 shorty64  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 18-January 10

Re: Elusive error

Posted 18 January 2010 - 04:54 PM

[quote name='TriggaMike' date='18 Jan, 2010 - 03:12 PM' post='896588']
Eclipse is a Java program and it doesn't touch your Registry. It doesn't install. You should delete it just for the sake of Hard Drive Space (Eclipse isn't exactly a small program).
[/quote

ok...loaded and it gave me the same error. I tried the "eclipsec.exe" and it gave a "... unable to load vm due to a heap error. not enough memory could be loaded...".....

The same issues as before. I am stumped
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2