🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: aus.computers.java
3 messages
3 total messages Started by Funtybugwana Tue, 28 Nov 2000 00:00
Newbie seeks help - I just have no idea???
#376
Author: Funtybugwana
Date: Tue, 28 Nov 2000 00:00
143 lines
5794 bytes
*** 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{

        //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;               //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          //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;
        }
   //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()
    {
    //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 ****
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
Re: Newbie seeks help - I just have no idea???
#409
Author: Paul Murray
Date: Wed, 06 Dec 2000 00:00
169 lines
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 ****
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
Re: Newbie seeks help - I just have no idea???
#410
Author: InMyTree
Date: Thu, 07 Dec 2000 00:00
151 lines
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 ****
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads