🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #376

Newbie seeks help - I just have no idea???

#376
From: 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 ****
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
Technical Details
Message-ID: <3a236d9f@post.newsfeeds.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10d6db,a73eb2a83698e2ed,start
X-Google-Attributes: gid10d6db,public
From: "Funtybugwana" <funtybugwana@icqmail.com>
Subject: Newbie seeks help - I just have no idea???
Date: 2000/11/28
Message-ID: <3a236d9f@post.newsfeeds.com>
X-Deja-AN: 698583173
X-Report: Please report illegal or inappropriate use to <abuse@newsfeeds.com>
X-Original-NNTP-Posting-Host: 203.46.192.123
X-Trace: 28 Nov 2000 02:32:31 -0600, 203.46.192.123
Organization: Newsfeeds.com http://www.newsfeeds.com 80,000+ UNCENSORED Newsgroups. The #1 Usenet Service on the Planet!
X-MSMail-Priority: Normal
X-Priority: 3
X-Comments: This message was posted through Newsfeeds.com's, FREE  publicly accessible Usenet Server   -  "post.newsfeeds.com"
Newsgroups: aus.computers.java
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-Comments2: IMPORTANT: Newsfeeds.com does not condone, nor support,  spam or any illegal or copyrighted postings.
X-Abuse-Info: Please be sure to forward a copy of ALL headers, INCLUDING the body (DO NOT SEND ATTACHMENTS)
X-Comments3: IMPORTANT: Under NO circumstances will postings containing illegal or copyrighted material through this service be tolerated!!