Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > function not defined

Reply
Thread Tools

function not defined

 
 
cleys
Guest
Posts: n/a
 
      08-23-2004
I am a VERY NEW programmer and having problems with the code below. I keep
getting an error "function undefined" Can someone please help.

{
for (int month = 0; month <361; month++)
System.out.println(month+" \t"+intPmtOut+" \t"+prinPmtOut+"
\t"+prinBalOut);

{
if (Math.abs(month % 12) == 0)

{
if (month < 361)
{
System.out.println("Press Enter to continue");
}
try
{
int temp = System.in.read();
}
catch(Exception error)
{
}
}
{
{
if (month < 361)
{
System.out.println("\t Interest \t Principal \t Principal");
System.out.println("Months \t Payment \t Payment \t Balance");
System.out.println(month+" \t"+intPmtOut+" \t"+prinPmtOut+"
\t"+prinBalOut);
}
}
}
}
}

 
Reply With Quote
 
 
 
 
Liz
Guest
Posts: n/a
 
      08-23-2004

"cleys" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) lkaboutprogramming.com...
> I am a VERY NEW programmer and having problems with the code below. I

keep
> getting an error "function undefined" Can someone please help.
>
> {
> for (int month = 0; month <361; month++)
> System.out.println(month+" \t"+intPmtOut+" \t"+prinPmtOut+"
> \t"+prinBalOut);
>
> {
> if (Math.abs(month % 12) == 0)
>
> {
> if (month < 361)
> {
> System.out.println("Press Enter to continue");
> }
> try
> {
> int temp = System.in.read();
> }
> catch(Exception error)
> {
> }
> }
> {
> {
> if (month < 361)
> {
> System.out.println("\t Interest \t Principal \t Principal");
> System.out.println("Months \t Payment \t Payment \t Balance");
> System.out.println(month+" \t"+intPmtOut+" \t"+prinPmtOut+"
> \t"+prinBalOut);
> }
> }
> }
> }
> }
>

Can you show the exact error message? Java Methods are not called functions.


 
Reply With Quote
 
 
 
 
Paul Lutus
Guest
Posts: n/a
 
      08-23-2004
cleys wrote:

> I am a VERY NEW programmer and having problems with the code below. I
> keep
> getting an error "function undefined" Can someone please help.


We have the solution to your problem, but first you have to tell us what the
problem is. Which line in your program is causing the error, and what is
the exact text of the error message?

--
Paul Lutus
http://www.arachnoid.com

 
Reply With Quote
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      08-23-2004
"cleys" <(E-Mail Removed)> writes:

> for (int month = 0; month <361; month++)
> System.out.println(month+" \t"+intPmtOut+" \t"+prinPmtOut+"
> \t"+prinBalOut);


That is all your for statement does.

> if (Math.abs(month % 12) == 0)


You do not need math.abs() when dealing with integers you know
beforehand to be positive.

> if (month < 361)
> {
> System.out.println("Press Enter to continue");
> }


The if ends here, meaning...

> try
> {
> int temp = System.in.read();
> }
> catch(Exception error)
> {
> }


.... this code is executed every time, not every 12 months.

You have a strange number of braces, leading me to conclue the error
is in the code you did not post.
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      08-23-2004
On Sun, 22 Aug 2004 23:26:07 -0400, cleys wrote:

> I am a VERY NEW programmer and having problems with the code below.


1) <http://www.physci.org/codes/javafaq.jsp#xpost>

> I keep getting an error "function undefined"


2) <http://www.physci.org/codes/javafaq.jsp#exact>

> Can someone please help.


See 1)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: __STDC_IEC_559__ (defined or !defined ?) Keith Thompson C Programming 0 08-17-2010 04:36 PM
User-defined exception: "global name 'TestRunError' is not defined" jmike@alum.mit.edu Python 1 07-10-2008 12:37 PM
defined? for recursive function call v/s defined? for function call stack Alok Ruby 3 04-13-2006 11:53 AM
Using parenthesis with defined (#if defined(...)) Angel Tsankov C++ 1 04-05-2006 10:00 PM
#if (defined(__STDC__) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) Oodini C Programming 1 09-27-2005 07:58 PM



Advertisments