Article View: aus.computers.java
Article #410Re: Newbie seeks help - I just have no idea???
From: InMyTree
Date: Thu, 07 Dec 2000 00:00
Date: Thu, 07 Dec 2000 00:00
151 lines
5598 bytes
5598 bytes
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:
<3a2ebb56$0$19407$7f31c96c@news01.syd.optusnet.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3a236d9f@post.newsfeeds.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,a73eb2a83698e2ed X-Google-Attributes: gid10d6db,public From: "InMyTree" <andrewhutchinson@NOSPAMERbigfoot.com> Subject: Re: Newbie seeks help - I just have no idea??? Date: 2000/12/07 Message-ID: <3a2ebb56$0$19407$7f31c96c@news01.syd.optusnet.com.au> X-Deja-AN: 701933999 References: <3a236d9f@post.newsfeeds.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Trace: 976141144 news01.syd.optusnet.com.au 19407 198.142.149.141 X-MSMail-Priority: Normal Newsgroups: aus.computers.java