Article View: aus.computers.java
Article #409Re: Newbie seeks help - I just have no idea???
From: Paul Murray
Date: Wed, 06 Dec 2000 00:00
Date: Wed, 06 Dec 2000 00:00
169 lines
6505 bytes
6505 bytes
If you are going to use a variable, you ned to declare it. Did you actually
mean
System.out.println(/* whatever */);
?
--
--------------------------------------------------------------
Repent! Quit your job! Slack off!
http://www.users.bigpond.com/pmurray
ICQ: 26066755
"InMyTree" <andrewhutchinson@NOSPAMERbigfoot.com> wrote in message
news:3a2ebb56$0$19407$7f31c96c@news01.syd.optusnet.com.au...
> have you declared the output variable as some kind of an output stream?
> Thats what I'd do..
>
> Funtybugwana <funtybugwana@icqmail.com> wrote in message
> news:3a236d9f@post.newsfeeds.com...
> > *** post for free via your newsreader at post.newsfeeds.com ***
> >
> > Hi, Im trying to get a head start on my Uni course starting next
semester.
> > Here is my code with the problem line highlighted. I wrote another
> program
> > with the same snippet of code but it didnt pick it up as an error. My
> email
> > address is funtybugwana@icqmail.com
> >
> > Thanks Mark
> >
> > This is the compiler output:
> > --------------------------- Compiler Output ---------------------------
> >
> > C4Q3.java:76: Undefined variable or class name: output
> >
> > output.append (callOutput + calldurationOutput + callCostOutput +
> > totalcallCostOutput + "\n");
> >
> > ^
> >
> >
> >
> > This is my code:
> >
> >
> >
> >
> > import java.awt.*;
> > import BreezyGUI.*;
> >
> >
> > public class C4Q3 extends GBFrame{
> >
> > file://format the header of the table. number represent number
of
> letters
> > plus spaces.
> >
> > String header = Format.justify('l',"Call no.",12) +
> > Format.justify('c',"Call Duration", 18) +
> > Format.justify('r',"Call Cost", 13) +
> > Format.justify('r',"Total Call Cost",20) + "\n";
> >
> >
> > Label TeleCallCostLabel = addLabel("TELECALLCOST INTERFACE", 1,1,1,1);
> > Label MinutesLabel = addLabel ("Enter No. Of Minutes",2,1,1,1);
> > DoubleField MinutesField = addDoubleField (0,2,2,1,1);
> > TextArea outputArea = addTextArea(header,4,1,6,4);
> > Button EnterButton = addButton ("Enter",8,2,1,1);
> > Button ResetButton = addButton ("Reset All",9,2,1,1);
> >
> >
> >
> > String callOutput, calldurationOutput, callCostOutput,
> > totalcallCostOutput;
> > double Minutes = 0; file://Initialise Variables
> > double Dollars = 0;
> > double total = 0;
> > int call = 0;
> >
> > public void buttonClicked (Button buttonObj){
> >
> > Minutes = MinutesField.getNumber();
> >
> > if (buttonObj == ResetButton)
> > /*Call resetGlobalVariable Method
> > *If Reset Button is pushed */
> > resetGlobalVariables();
> >
> > if (buttonObj == EnterButton)
> > call = ++call;
> >
> > if(Minutes <= 0)
> > messageBox file://Configure Printout in Message Box
> > ("Sorry, We cannot Give Refunds!" + "\n" +
> > "Enter a Positive Number to Continue" + "\n");
> >
> > if (Minutes <= 2 && Minutes > 0){
> > Dollars = 1.15;
> > total = Dollars + total;
> > }
> > else{
> > Dollars=((Minutes - 2.0) * 0.50) + 1.15 ;
> > total = Dollars + total;
> > }
> > file://Format the output data
> >
> > callOutput = Format.justify('l', call, 12);
> > calldurationOutput = Format.justify('c', Minutes ,18, 2);
> > callCostOutput = Format.justify('r', Dollars, 13, 2);
> > totalcallCostOutput = Format.justify('r', total, 20, 2);
> >
> > // Output data
> > output.append (callOutput + calldurationOutput + callCostOutput +
> > totalcallCostOutput + "\n"); **** THIS IS THE PROBLEM LINE****
> >
> >
> > }
> >
> > /**********************************************************************/
> >
> > private void resetGlobalVariables()
> > {
> > file://Global variables reset here
> > Minutes = 0;
> > Dollars = 0;
> > MinutesField.setNumber (0);
> >
> > }
> >
> > /*********************************************************************/
> >
> >
> > public static void main (String [] args)
> >
> > {
> > Frame frm = new C4Q3();
> > frm.setSize (600, 600);
> > frm.setVisible (true);
> > }
> >
> > }
> >
> >
> >
> >
> > **** Post for FREE via your newsreader at post.newsfeeds.com ****
> >
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > *** Newsfeeds.com - The #1 Usenet Newsgroup Service on The Planet! ***
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > http://www.newsfeeds.com | http://www.newsfeeds.com
> > |
> > * Anonymous posting server! | * Totally Uncensored!
> > * SUPER Servers! | * Over 80,000 Newsgroups!
> > * BINARIES ONLY Servers! | * 16 seperate Newsgroup Servers!
> > * SPAM FILTERED Server! | * Instant access!
> > * ADULT ONLY Server! | * Multiple OC 3's and OC 12's!
> > * MP3 ONLY Server! | * 99% Article Completion!
> > * MULTIMEDIA ONLY Server! | * Months of Retention!
> > * 7 UNCENSORED Newsgroup Servers | * Lightning FAST downloads!
> > |
> > http://www.newsfeeds.com | http://www.newsfeeds.com
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > **** Point your newsreader to post.newsfeeds.com ****
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
Technical Details
Message-ID:
<smGX5.153825$e5.101545@newsfeeds.bigpond.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3a236d9f@post.newsfeeds.com> <3a2ebb56$0$19407$7f31c96c@news01.syd.optusnet.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,a73eb2a83698e2ed X-Google-Attributes: gid10d6db,public From: "Paul Murray" <pmurray@nospam.bigpond.com> Subject: Re: Newbie seeks help - I just have no idea??? Date: 2000/12/06 Message-ID: <smGX5.153825$e5.101545@newsfeeds.bigpond.com> X-Deja-AN: 702065953 References: <3a236d9f@post.newsfeeds.com> <3a2ebb56$0$19407$7f31c96c@news01.syd.optusnet.com.au> X-Priority: 3 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 X-Trace: newsfeeds.bigpond.com 976171544 203.54.250.84 (Thu, 07 Dec 2000 17:45:44 EST) Organization: Telstra BigPond Internet Services (http://www.bigpond.com) X-MSMail-Priority: Normal NNTP-Posting-Date: Thu, 07 Dec 2000 17:45:44 EST Newsgroups: aus.computers.java