Need help on last method in this class

import java.util.*;
import java.util.Random;
class Homework2
static Scanner keyboard = new Scanner(System.in);
public static void main(String args[])
final int beer = 1;
final int ale = 2;
final int wine = 3;
final int bourbon = 4;
final int scotch = 5;
final int rum = 6;
final int water = 7;
int x = getRandom(beer, ale, wine, bourbon, scotch, rum, water);
switch(x)
case 1:
System.out.println("first drink is beer");
     break;
     case 2:
System.out.println("first drink is ale");
     break;
     case 3:
System.out.println("first drink is wine");
     break;
case 4:
System.out.println("first drink is bourbon");
     break;
     case 5:
System.out.println("first drink is scotch");
     break;
case 6:
System.out.println("first drink is rum");
     break;
case 7:
System.out.println("first drink is water");
     break;
int y = getRandom2(beer, ale, wine, bourbon, scotch, rum, water);
switch(y)
case 1:
System.out.println("first drink is beer");
     break;
     case 2:
System.out.println("first drink is ale");
     break;
     case 3:
System.out.println("first drink is wine");
     break;
case 4:
System.out.println("first drink is bourbon");
     break;
     case 5:
System.out.println("first drink is scotch");
     break;
case 6:
System.out.println("first drink is rum");
     break;
case 7:
System.out.println("first drink is water");
     break;
System.out.print(x + " " + y);
double z = alcoholicCon(x,y); (* Here is where i started with problems*)
System.out.println(z);
public static int getRandom(int a, int b, int c, int d, int e, int f, int g)
Random generator = new Random();
return (int)(1 + Math.random()* 7);
public static int getRandom2(int h, int i, int j, int k, int l, int m, int n)
Random generator = new Random();
return (int)(1 + Math.random()* 7);
public static double alcoholicCon(int o, int p,) (*Error here*)
double content1;
double content2;
double content;
if(o==1)
content1=.04;
if(o==2)
content1=.07;
if(o==3)
content1=.12;
if(o==4)
content1=.40;     
if(o==5)
content1=.60;
if(o==6)
content1=.77;          
if(o==7)
content1=.00;
if(p==1)
content2=.04;
if(p==2)
content2=.07;
if(p==3)
content2=.12;
if(p==4)
content2=.40;     
if(p==5)
content2=.60;
if(p==6)
content2=.77;          
if(p==7)
content2=.00;
     content = content1 + content2;
     return content;      
Here is the program everything worked great till i added the last method, i keep getting a illegal start of type error message now. Do i have to switch my data type in the main? or do i have to switch it down in the method?

WOW, Im not sure what you are trying to do.
What was the compiler error?
Just an observation,
Both of your getRandom() and getRandom2(), you pass in 7 parameters and do nothing with them. you really do not need to do this. Also both of those methods do exactly the same thing, the same way. Thats just redundant.
You could say something like:
     public static int newRandom(){
        return (int) (1 + Math.random() * 7);
    }Also check your method signature for the
public static double alcoholicCon(int o, int p,){I see your error, do you? Hint: too much punctuation...
Also, you should initialize your method variables to a value.
Darn too slow...
Message was edited by:
Java_Jay

Similar Messages

  • Need help in compare method of Comparator class

    I am writing a program that will display elements of a TreeMap in an order in which I want. By default the order is ascending. To change the order I need to override the compare method of the Comparator class.
    I've done this in my code below.
    I want to display keys with lower-case 1st and then those with upper-case.
    Please help.
    import java.util.*;
    public class MyComparator implements Comparator {
      public int compare(Object o1, Object o2) {
        String s1 = o1.toString();
        String s2 = o2.toString();
        return s1.compareTo(s2);
      public static void main(String[] args) {
        Map names = new TreeMap(new MyComparator());
        names.put("a", new Integer(1435)); 
        names.put("b", new Integer(1110));
        names.put("A", new Integer(1425));
        names.put("B", new Integer(987));
        names.put("C", new Integer(1323));   
        Set namesSet = names.keySet();
        Iterator iter = namesSet.iterator();
        while(iter.hasNext()) {
          String who = (String)iter.next();
          System.out.println(who + " => " +     names.get(who));
    }

    public int compare(Object o1, Object o2) {
        String s1 = o1.toString();
        String s2 = o2.toString();
        String ss1 = beginsWithLowerLetter(s1)? s1.toUpperCase() : s1.toLowerCase();
        String ss2 = beginsWithLowerLetter(s2)? s2.toUpperCase() : s2.toLowerCase();
        return ss1.compareTo(ss2);
    }

  • I need  to implement clone method  in theAdvancedDataGrid class

    I need  to implement clone method  in theAdvancedDataGrid class, to copy the object in its completeness   Could anyone give me a helping hand.

    Hi Nikos,
    from youe question it's not clear what do you need to copy: data, parts of ADG (GUI) or something else?
    If it's not a GUI - only data - you can use mx.utils.ObjectUtil.copy(value:Object):Object

  • HT1338 I AM HAVING SO MANY PROBLE TRYING TO DOWNLOAD Mac OS X version 10.7.5 TO MY MACBOOK, I NEED HELP, I HAVE ALREADY PURCHASE THIS PRODUCT OVER A MONTH AGO

    I AM HAVING SO MANY PROBLEMS TRYING TO DOWNLOAD Mac OS X version 10.7.5 TO MY MACBOOK, I NEED HELP, I HAVE ALREADY PURCHASE THIS PRODUCT OVER A MONTH AGO

    lkimmie wrote:
    I AM HAVING SO MANY PROBLEMS TRYING TO DOWNLOAD Mac OS X version 10.7.5 TO MY MACBOOK, I NEED HELP, I HAVE ALREADY PURCHASE THIS PRODUCT OVER A MONTH AGO
    Firstly, please turn off your Caps lock. It is considered shouting in forums.
    Secondly, please explain your exact issue and wheteher or not you can see your purchase in the App Store and if you are using the same Apple ID to reinstall it with as you used to purcase it with.
    Thanks
    Pete

  • Need help with Sound Methods

    Hi, I am new to java and need help with sound methods.
    q: create a new method that will halve the volume of the positive values and double the volume of the negative values.
    Message was edited by:
    Apaula30

    duplicate message #2

  • Hi, Need help about ios7 upgrade, after this upgrade I cannot watch youtube or any video with my Ipad,

    Hi, Need help about ios7 upgrade, after this upgrade I cannot watch youtube or any video with Ipad, and Iphone as well
    I think my wireless rooter's setting has some problem but cannot found anything to solve,
    I can watch if there is another wireless network , I tried this option in another place who has wireless network and I can watch.
    Do you have any idea to do these setting , I dont have any problem when Ipad has 6.1.3 IOS,
    need help
    thanks

    Thanks
    I will and share the result.

  • Need help calling a method from an immutable class

    I'm having difficulties in calling a method from my class called Cabin to my main. Here's the code in my main              if(this is where i want my method hasKitchen() from my Cabin class)
                        System.out.println("There is a kitchen.");
                   else
                        System.out.println("There is not a kitchen.");
                   }and here's my method from my Cabin class:public boolean hasKitchen()
         return kitchen;
    }

    You should first have an instance of Cabin created by using
       Cabin c = ....
       if (c.hasKitchen()) {
         System.out.println("There is a kitchen.");
       } else {
            System.out.println("There is not a kitchen.");
       }

  • Need help with calling method

    I'm new to Java, trying to pass a required class so I can graduate this semester, and I need help figuring out what is wrong with the code below. My assignment is to create a program to convert celsius to fahrenheit and vice versa using Scanner for input. The program must contain 3 methods - main, convert F to C, method, and convert C to F method. Requirements of the conversion methods are one parameter which is an int representing temp, return an int representing calculated temp after doing appropriate calculation, should not display info to user, and should not take in info from user.
    The main method is required to ask the user to input a 1 for converting F to C, 2 for C to F, and 3 to end the program. It must include a while loop that loops until the user enters a 3, ask the user to enter a temp, call the appropriate method to do the conversion, and display the results. I'm having trouble calling the conversion methods and keep getting the following 2 compiler errors:
    cannot find symbol
    symbol : method farenheitToCelsius(int)
    location: class WondaPavoneTempConverter
    int celsius = farenheitToCelsius(intTemp);
    ^
    cannot find symbol
    symbol : method celsiusToFarenheit(int)
    location: class WondaPavoneTempConverter
    int farenheit = celsiusToFarenheit(intTemp);
    The code is as follows:
    public static void main(String[] args) {
    // Create a scanner
    Scanner scanner = new Scanner(System.in);
    // Prompt the user to enter a temperature
    System.out.println("Enter the temperature you wish to convert as a whole number: ");
    int intTemp = scanner.nextInt();
    System.out.println("You entered " + intTemp + " degrees.");
    // Prompt the user to enter "1" to convert to Celsius, "2" to convert to
    // Farenheit, or "3" to exit the program
    System.out.println("Enter 1 to convert to Celsius, 2 to convert to Farenheit, or 3 to exit.");
    int intConvert = scanner.nextInt();
    // Convert temperature to Celsius or Farenheit
    int celsius = farenheitToCelsius(intTemp);
    int farenheit = celsiusToFarenheit(intTemp);
    while (intConvert >= 0) {
    // Convert to Celsius
    if (intConvert == 1) {
    System.out.println("Celsius is " + celsius + " degrees.");
    // Convert to Farenheit
    else if (intConvert == 2) {
    System.out.println("Farenheit is " + farenheit + " degrees.");
    // Exit program
    else if (intConvert == 3) {
    break;
    else {
    System.out.println("The number you entered is invalid. Please enter 1, 2, or 3.");
    //Method to convert Celsius to Farenheit
    public static int celsiusToFahrenheit(int cTemp) {
    return (9 / 5) * (cTemp + 32);
    //Method to convert Farenheit to Celsius
    public static int fahrenheitToCelsius(int fTemp) {
    return (5 / 9) * (fTemp - 32);
    I readily admit I'm a complete dunce when it comes to programming - digital media is my area of expertise. Can anyone point me in the right direction? This assignment is due very soon. Thanks.

    1) consider using a boolean variable in the while statement and converting it to true if the input is good.
    while (inputNotValid)
    }2) put the code to get the input within the while loop. Try your code right now and enter the number 30 when your menu requests for input and you'll see the infinite loop.... and why you need to request input within the loop.
    3) Fix your equations. You are gonig to have to do some double calcs, even if you convert it back to int for the method return. Otherwise the results are just plain wrong. As a good test, put in the numbers -40, 0, 32, 100, and 212. Are the results as expected? (-40 is the only temp that is the same for both cent and fahr). I recommend doing double calcs and then casting the result to int in the return. for example:
    int a = (int) (20 + 42.0 / 3);  // the 42.0 forces the compiler to do double calc.4) One of your equations may still be plain wrong even with this fix. Again, run the test numbers and see.
    5) Also, when posting your code, please use code tags so that your code will be well-formatted and readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:
    [code]
      // your code block goes here.
    [/code]

  • Need help with custom event from Main class to an unrelated class.

    Hey guys,
    I'm new to Flash and not great with OOP.  I've made it pretty far with google and lurking, but I've been pulling my hair out on this problem for a day and everything I try throws an error or simply doesn't hit the listener.
    I'm trying to get my Main class to send a custom event to an unrelated class called BigIcon.  The rest of the code works fine, it's just the addEventListener and dispatchEvent that isn't working.
    I've put in the relevant code in below.  Let me know if anything else is needed to troubleshoot.  Thank you!
    Main.as
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        public class Main extends MovieClip
            var iconLayer_mc:MovieClip = new MovieClip();
            public function Main()
                Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
                addChildAt(iconLayer_mc,0);
                placeIcons();
            function placeIcons():void
                var i:int;
                var j:int;
                for (i = 0; i < 4; i++)
                    for (j = 0; j < 5; j++)
                        //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                        var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i,j);
                        iconLayer_mc.addChild(placedIcon_mc);
            function fl_MouseClickHandler(event:MouseEvent):void
                dispatchEvent(new Event("twitchupEvent",true));
    BigIcon.as
    package
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.utils.getDefinitionByName;
        public class BigIcon extends MovieClip
            private var iconImage_str:String;
            private var iconRow_int:int;
            private var iconColumn_int:int;
            public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
                iconImage_str = iconImage_arg;
                iconRow_int = iconRow_arg;
                iconColumn_int = iconColumn_arg;
                this.addEventListener(Event.ADDED_TO_STAGE, Setup);
            function Setup(e:Event)
                this.y = iconRow_int;
                this.x = iconColumn_int;
                var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
                var thisIcon_mc:MovieClip = new ClassReference;
                this.addChild(thisIcon_mc);
                addEventListener("twitchupEvent", twitchUp);
            function twitchUp(e:Event)
                this.y +=  10;

    Ned Murphy wrote:
    You should be getting an error for the Main.as class due to missing a line to import the Event class...
    import flash.events.Event;
    My apologies, I should attempt to compile my example code before I ask for help...
    Alright, this compiles, gives me no errors, shows my 'book' and 'flowers' icons perfectly when ran, and prints 'addEventListener' to the output window as expected.  I get no errors when I press the button, 'dispatchEvent' is output (good), but the 'twitchUp' function is never called and 'EventTriggered' is never output. 
    How do I get the 'twitchUp' event to trigger?
    Main.as
    package
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.events.*;
        public class Main extends MovieClip
            var iconLayer_mc:MovieClip = new MovieClip();
            var iconString_array:Array = new Array(2);
            public function Main()
                Spin_btn.addEventListener(MouseEvent.CLICK,fl_MouseClickHandler);
                addChildAt(iconLayer_mc,0);
                buildStringArray();
                placeIcons();
            function buildStringArray():void
                var i:int;
                var j:int;
                for (i = 0; i < 2; i++)
                    iconString_array[i] = new Array(3);
                    for (j = 0; j < 3; j++)
                        if (Math.random() > .5)
                            //'flowers' is the name of an illustrator object that has been converted to a MovieClip and is in the library
                            iconString_array[i][j] = "flowers";
                        else
                            //'book' is the name of an illustrator object that has been converted to a MovieClip and is in the library
                            iconString_array[i][j] = "book";
            function placeIcons():void
                var i:int;
                var j:int;
                for (i = 0; i < 2; i++)
                    for (j = 0; j < 3; j++)
                        //iconString_array has the names of illustrator objects that have been converted to MovieClips and are in the library.
                        var placedIcon_mc:BigIcon = new BigIcon(iconString_array[i][j],i*50,j*50);
                        iconLayer_mc.addChild(placedIcon_mc);
            function fl_MouseClickHandler(event:MouseEvent):void
                dispatchEvent(new Event("twitchupEvent",true));
                trace("dispatchEvent");
    BigIcon.as
    package
        import flash.display.MovieClip;
        import flash.events.*;
        import flash.utils.getDefinitionByName;
        public class BigIcon extends MovieClip
            private var iconImage_str:String;
            private var iconRow_int:int;
            private var iconColumn_int:int;
            public function BigIcon(iconImage_arg:String, iconRow_arg:int, iconColumn_arg:int)
                iconImage_str = iconImage_arg;
                iconRow_int = iconRow_arg;
                iconColumn_int = iconColumn_arg;
                this.addEventListener(Event.ADDED_TO_STAGE, Setup);
            function Setup(e:Event)
                this.y = iconRow_int;
                this.x = iconColumn_int;
                var ClassReference:Class = getDefinitionByName(iconImage_str) as Class;
                var thisIcon_mc:MovieClip = new ClassReference;
                this.addChild(thisIcon_mc);
                addEventListener("twitchupEvent", twitchUp);
                trace("addEventListener");
            function twitchUp(e:Event)
                this.y +=  10;
                trace("EventTriggered");
    Output:
    [SWF] Untitled-1.swf - 40457 bytes after decompression
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    addEventListener
    dispatchEvent
    [UnloadSWF] Untitled-1.swf
    Test Movie terminated.

  • Need help getting these methods to work

    this program consists three seperate classes. i have two of the three working, i just can't figure out this one. here is my code, and the pseudo code for the methods. any help would be greatly appreciated. i am getting the following 18 errors
    CheckingAccountsTest.java:35: getAccountType(java.lang.String) in CheckingAccount cannot be applied to ()
    if(myFields[indexForAccountType].equals(CheckingAccount.getAccountType())){ //A-1-2-10
    ^
    CheckingAccountsTest.java:45: cannot find symbol
    symbol : constructor CheckingAccountPlus(java.lang.String,java.lang.String,java.lang.String,double)
    location: class CheckingAccountPlus
    CheckingAccountPlus currentAccount = new CheckingAccountPlus(myFields[indexForAccountId], //A-1-2-17 THROUGH A-1-2-20
    ^
    CheckingAccountsTest.java:72: getAccountId(java.lang.String) in CheckingAccount cannot be applied to ()
    currentAccount.getAccountId().equals(myFields[indexForAccountId]); //A-1-3-06
    ^
    CheckingAccountsTest.java:124: cannot find symbol
    symbol : method makeDeposit(double)
    location: class CheckingAccountPlus
    currentAccount.makeDeposit(amount); //A-1-6-02
    ^
    CheckingAccountsTest.java:161: getAccountId(java.lang.String) in CheckingAccount cannot be applied to ()
    currentAccount, currentAccount.getAccountId(), CheckingAccount.getAccountType(), currentAccount.getBalance());
    ^
    CheckingAccountsTest.java:161: getAccountType(java.lang.String) in CheckingAccount cannot be applied to ()
    currentAccount, currentAccount.getAccountId(), CheckingAccount.getAccountType(), currentAccount.getBalance());
    ^
    CheckingAccountsTest.java:167: non-static method getAccountType() cannot be referenced from a static context
    currentAccount, currentAccount.getAccountId(), CheckingAccountPlus.getAccountType(), currentAccount.getBalance());
    ^
    CheckingAccountsTest.java:171: getAccountId(java.lang.String) in CheckingAccount cannot be applied to ()
    System.out.printf("Account Totals", currentAccount.getAccountId(), CheckingAccount.getAccountType(), //A-1-11-01
    ^
    CheckingAccountsTest.java:171: getAccountType(java.lang.String) in CheckingAccount cannot be applied to ()
    System.out.printf("Account Totals", currentAccount.getAccountId(), CheckingAccount.getAccountType(), //A-1-11-01
    ^
    CheckingAccountsTest.java:172: getBeginningBalance(double) in CheckingAccount cannot be applied to ()
    currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-11-02
    ^
    CheckingAccountsTest.java:172: getDeposits(double) in CheckingAccount cannot be applied to ()
    currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-11-02
    ^
    CheckingAccountsTest.java:172: getWithdrawals(double) in CheckingAccount cannot be applied to ()
    currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-11-02
    ^
    CheckingAccountsTest.java:173: getFees(double) in CheckingAccount cannot be applied to ()
    currentAccount.getFees(), currentAccount.getBalance(), currentAccount.getOverdrafts(), " *"); //A-1-11-03 THROUGH A-1-11-04
    ^
    CheckingAccountsTest.java:173: getOverdrafts(double) in CheckingAccount cannot be applied to ()
    currentAccount.getFees(), currentAccount.getBalance(), currentAccount.getOverdrafts(), " *"); //A-1-11-03 THROUGH A-1-11-04
    ^
    CheckingAccountsTest.java:178: getAccountType(java.lang.String) in CheckingAccount cannot be applied to ()
    System.out.printf("Account Totals", currentAccount.getAccountId(), CheckingAccount.getAccountType(), //A-1-12-01
    ^
    CheckingAccountsTest.java:179: cannot find symbol
    symbol : method getBeginningBalance()
    location: class CheckingAccountPlus
    currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-12-02
    ^
    CheckingAccountsTest.java:179: cannot find symbol
    symbol : method getDeposits()
    location: class CheckingAccountPlus
    currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-12-02
    ^
    CheckingAccountsTest.java:180: cannot find symbol
    symbol : method getSumOfCreditCardAdvances()
    location: class CheckingAccountPlus
    currentAccount.getBalance(), currentAccount.getSumOfCreditCardAdvances(), " *"); //A-1-12-03 THROUGH A-1-12-04
    ^
    18 errors
    Process completed.
    public class CheckingAccountsTest
         private static final int indexForAccountId = 0;
         private static final int indexForAccountType = 2;
         private static final int indexForBalance = 5;
         private static final int indexForDepositAmount = 2;
         private static final int indexForFirstName = 3;
         private static final int indexForLastName = 4;
         private static final int indexForRecordType = 1;
         private static final int indexForWithdrawalAmount = 2;
         private static final String recordTypeForDeposit = "CKD";
         private static double sumOfBeginningBalances = 0.0;
         private static double sumOfCreditCardAdvances = 0.0;
         private static double sumOfDeposits = 0.0;
         private static double sumOfEndingBalances = 0.0;
         private static double sumOfFees = 0.0;
         private static double sumOfOverdrafts = 0.0;
         private static double sumOfWithdrawals = 0.0;
    public static void main(String args[])
         MyCsvFile myFile = new MyCsvFile("monthlyBankTransactions,v05.txt"); //A-1-2-01 THRU A-1-2-02
         System.out.println("\nBig Bank: Monthly Checking Account Activity\n"); //A-1-2-04
         System.out.println("----------- Account ----------- Beginning\t\t    With-\t\t   Ending\tOver-\tCredit Cd"); //A-1-2-05
         System.out.println("     Name\t   Id    Type\t Balance   +   Deposit   -  drawal   -    Fee   =  Balance\tdraft\t Advance\n"); //A-1-2-06
         myFile.readARecord(); //A-1-2-07
         while(myFile.getEofFound() == false) //A-1-2-08
              String []myFields = myFile.getCsvRecordFieldArray();//A-1-2-09
              if(myFields[indexForAccountType].equals(CheckingAccount.getAccountType())){ //A-1-2-10
             CheckingAccount currentAccount = new CheckingAccount(myFields[indexForAccountId], //A-1-2-11 THROUGH A-1-2-12
             myFields[indexForFirstName], myFields[indexForLastName],
             Double.parseDouble(myFields[indexForBalance])); //A-1-2-13
             handleAccount(currentAccount, myFile, myFields); //A-1-2-14
             currentAccount = null;// A-1-2-15
        else//A-1-2-16
             CheckingAccountPlus currentAccount = new CheckingAccountPlus(myFields[indexForAccountId], //A-1-2-17 THROUGH A-1-2-20
             myFields[indexForFirstName], myFields[indexForLastName], Double.parseDouble(myFields[indexForBalance]));
             handleAccount(currentAccount, myFile, myFields);
             currentAccount = null; //A-1-2-21
        }//end if A-1-2-22
    }//end while A-1-2-23
         System.out.printf("Report Totals", sumOfBeginningBalances,sumOfDeposits, //A-1-2-24
         sumOfWithdrawals, sumOfFees, sumOfEndingBalances, sumOfOverdrafts, sumOfCreditCardAdvances, "**"); //A-1-2-25
         System.out.printf("The information in the above report is from the 17 records in the following file:",
         myFile.getCountOfRecords());                                                                           //A-1-2-26
         System.out.printf("Path to file:", myFile.getFilePath()); //A-1-2-27
         System.out.printf("Name of file:", myFile.getFileName()); //A-1-2-28
         System.out.println("\nEnd of program"); //A-1-2-29
    }// end main method
    public static void handleAccount(CheckingAccount currentAccount, MyCsvFile myFile, String []myFields)
         sumOfBeginningBalances += currentAccount.getBalance(); //A-1-3-01
         printBeginningBalance(currentAccount); // A-1-3-02
         myFile.readARecord(); //A-1-3-03
         myFields = myFile.getCsvRecordFieldArray(); //A-1-3-04
    while (myFile.getEofFound() == false) //A-1-3-05
       currentAccount.getAccountId().equals(myFields[indexForAccountId]); //A-1-3-06
    if(myFields[indexForRecordType].equals(recordTypeForDeposit)){ //A-1-3-07
         handleDeposit(currentAccount, Double.parseDouble(myFields[indexForDepositAmount])); //A-1-3-08 THROUGH A-1-3-09
          else //A-1-3-10
          handleWithdrawal(currentAccount,Double.parseDouble(myFields[indexForWithdrawalAmount])); //A-1-3-11 THROUGH A-1-3-12
       }//end if //A-1-3-13
    myFile.readARecord();//A-1-3-14
    myFields = myFile.getCsvRecordFieldArray(); //A-1-3-15 THROUGH A-1-3-16
    }//end while //A-1-3-17
    sumOfEndingBalances += currentAccount.getBalance();//A-1-3-18
    printEndingBalance(currentAccount); //A-1-3-19
    public static void handleAccount(CheckingAccountPlus currentAccount, MyCsvFile myFile, String [] myFields)
    sumOfBeginningBalances += currentAccount.getBalance(); //A-1-4-01
    printBeginningBalance(currentAccount); //A-1-4-02
    myFile.readARecord(); //A-1-4-03
    myFields = myFile.getCsvRecordFieldArray(); //A-1-4-04
      while (myFile.getEofFound()==false) //A-1-4-05
    currentAccount.getAccountId().equals (myFields[indexForAccountId]); //A-1-4-06
    if(myFields[indexForRecordType].equals(recordTypeForDeposit)){ //A-1-4-07
         handleDeposit(currentAccount, Double.parseDouble(myFields[indexForDepositAmount])); //A-1-4-08 THROUGH //A-1-4-09
          else //A-1-4-10
          handleWithdrawal(currentAccount,Double.parseDouble(myFields[indexForWithdrawalAmount])); //A-1-4-11 THROUGH A-1-4-12
       }//end if A-1-4-13
    myFile.readARecord(); //A-1-4-14
    myFields = myFile.getCsvRecordFieldArray(); //A-1-4-15 THROUGH A-1-4-16
    }//end while A-1-4-17
    sumOfEndingBalances += currentAccount.getBalance(); //A-1-4-18
    printEndingBalance(currentAccount); //A-1-4-19
    private static void handleDeposit(CheckingAccount currentAccount, double amount)
    sumOfDeposits += amount; //A-1-5-01
    currentAccount.makeDeposit(amount); //A-1-5-02
    System.out.printf("$,%.2f", amount); //A-1-5-03
      private static void handleDeposit(CheckingAccountPlus currentAccount, double amount)
      sumOfDeposits += amount;//A-1-6-01
      currentAccount.makeDeposit(amount); //A-1-6-02
      System.out.printf("$,%.2f", amount); //A-1-6-03
      private static void handleWithdrawal(CheckingAccount currentAccount, double amount)
      if (currentAccount.makeWithdrawal(amount) == true){ //A-1-7-01
       sumOfWithdrawals += amount; //A-1-7-02
       System.out.printf("$,%.2f", amount); //A-1-7-03
      }else{ //A-1-7-04
       double overdraftFee = currentAccount.getOverdraftFee(); //A-1-7-05
       sumOfFees += overdraftFee; //A-1-7-06
       sumOfOverdrafts += amount; //A-1-7-07
       System.out.printf("$,%.2f",overdraftFee, amount); //A-1-7-08
      }//end if A-1-7-09
      private static void handleWithdrawal(CheckingAccountPlus currentAccount, double amount)
           if (currentAccount.makeWithdrawal(amount) == true){ //A-1-8-01
            sumOfWithdrawals += amount; //A-1-8-02
            System.out.printf("$,%.2f",amount); //A-1-8-03
      }else{ //A-1-8-04
       double creditCardAdvance = currentAccount.getCreditCardAdvance(); //A-1-8-05 THROUGH A-1-8-06
       sumOfCreditCardAdvances += creditCardAdvance; //A-1-8-07
       sumOfWithdrawals += currentAccount.getActualWithdrawal(); //A-1-8-08
       System.out.printf("$,%.2f",currentAccount.getActualWithdrawal(),creditCardAdvance); //A-1-8-09
      }//end if //A-1-8-10
    private static void printBeginningBalance(CheckingAccount currentAccount)
    System.out.printf("",   //A-1-9-01 THROUGH A-1-9-02
       currentAccount, currentAccount.getAccountId(), CheckingAccount.getAccountType(), currentAccount.getBalance());
    private static void printBeginningBalance(CheckingAccountPlus currentAccount)
    System.out.printf("",   //A-1-10-01 TROUGH A-1-10-02
       currentAccount, currentAccount.getAccountId(), CheckingAccountPlus.getAccountType(), currentAccount.getBalance());
    private static void printEndingBalance(CheckingAccount currentAccount)
      System.out.printf("Account Totals", currentAccount.getAccountId(), CheckingAccount.getAccountType(), //A-1-11-01
        currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-11-02
        currentAccount.getFees(), currentAccount.getBalance(), currentAccount.getOverdrafts(), " *"); //A-1-11-03 THROUGH A-1-11-04
    private static void printEndingBalance(CheckingAccountPlus currentAccount)
      System.out.printf("Account Totals", currentAccount.getAccountId(), CheckingAccount.getAccountType(), //A-1-12-01
        currentAccount.getBeginningBalance(), currentAccount.getDeposits(), currentAccount.getWithdrawals(), //A-1-12-02
        currentAccount.getBalance(), currentAccount.getSumOfCreditCardAdvances(), " *"); //A-1-12-03 THROUGH A-1-12-04
    }PSEUDO CODE FOR ALL METHODS
    This public static method has no return value and has one parameter of type String named args[ ], an array
    A-1-2-01)     INSTANTIATE a local variable named myFile of class MyCsvFile, passing a single String argument for the CSV filename:
    A-1-2-02)          ?monthlyBankTransactions,v05.txt?
    A-1-2-03)     DISPLAY the task / programmer identification line
    A-1-2-04)     DISPLAY the ?Big Bank: Monthly Checking Account Activity? title line
    A-1-2-05)     DISPLAY the first column heading line: ?---------- Account ----------??
    A-1-2-06)     DISPLAY the second column heading line: ? Name Id??
    A-1-2-07)     Get 1st record from CSV file using method readARecord: MyCsvFile class: myFile.readARecord()
    A-1-2-08)     WHILE (myFile.getEofFound() IS FALSE)
    A-1-2-09)          DEFINE a String Array named myFields, and ASSIGN it the value myFile.getCsvRecordFieldArray()
    A-1-2-10)          IF (myFields[indexForAccountType].equals(CheckingAccount.getAccountType()))
    A-1-2-11)               INSTANTIATE a local variable named currentAccount of class CheckingAccount, passing the following arguments:
    A-1-2-12)                    myFields[indexForAccountId], myFields[indexForFirstName], myFields[indexForLastName],
    A-1-2-13)                    Double.parseDouble(myFields[indexForBalance])
    A-1-2-14)               CALL method handleAccount of this class, passing the following arguments: currentAccount, myFile, myFields
    A-1-2-15)               ASSIGN null TO currentAccount
    A-1-2-16)          ELSE
    A-1-2-17)     INSTANTIATE a local variable named currentAccount of class CheckingAccountPlus, passing the following arguments:
    A-1-2-18)          myFields[indexForAccountId], myFields[indexForFirstName], myFields[indexForLastName],
    A-1-2-19)          Double.parseDouble(myFields[indexForBalance])
    A-1-2-20)     CALL method handleAccount of this class, passing the following arguments: currentAccount, myFile, myFields
    A-1-2-21)               ASSIGN null TO currentAccount
    A-1-2-22)          END IF
    A-1-2-23)     END WHILE
    A-1-2-24)     DISPLAY the report-total line using the following arguments: ?Report Totals?, sumOfBeginningBalances, sumOfDeposits,
    A-1-2-25)          sumOfWithdrawals, sumOfFees, sumOfEndingBalances, sumOfOverdrafts, sumOfCreditCardAdvances and ?**?
    A-1-2-26)     DISPLAY the ?The information in the above report? line with the following arguments: myFile.getCountOfRecords()
    A-1-2-27)     DISPLAY the ?Path to file? line with the following arguments: myFile.getFilePath()
    A-1-2-28)     DISPLAY the ?Name of file? line with the following arguments: myFile.getFileName()
    A-1-2-29)     DISPLAY the ?End of program? line
    This private static method has no return value, and has three parameters: currentAccount of type CheckingAccount, myFile of type MyCsvFile and myFields of type String array.
    A-1-3-01)     CALL method currentAcccount.getBalance and ADD its return value to sumOfBeginningBalances
    A-1-3-02)     CALL method printBeginningBalance with the following argument list: currentAccount
    A-1-3-03)     CALL method myFile.readARecord, which reads the 1st record after the Balance record (a deposit or withdrawal) for the current customer
    A-1-3-04)     CALL method myFile.getCsvRecordFieldArray and ASSIGN its return value to myFields, a String array. This makes the values from the
    A-1-3-05)          fields in the record just read available for access as elements in the myFields string array
    A-1-3-06)     WHILE (myFile.getEofFound() IS FALSE AND currentAccount.getAccountId().equals(myFields[indexForAccountId]))
    A-1-3-07)          IF (myFields[indexForRecordType].equals(recordTypeForDeposit))
    A-1-3-08)               CALL method handleDeposit with the following argument list: currentAccount,
    A-1-3-09)                    Double.parseDouble(myFields[indexForDepositAmount]
    A-1-3-10)          ELSE
    A-1-3-11)               CALL method handleWithdrawal with the following argument list: currentAccount,
    A-1-3-12)                    Double.parseDouble(myFields[indexForWithdrawalAmount]
    A-1-3-13)          END IF
    A-1-3-14)          CALL method myFile.readARecord, which reads the next deposit or withdrawal record, if any, for this customer
    A-1-3-15)     CALL method myFile.getCsvRecordFieldArray and ASSIGN its return value to myFields, a String array. This makes the value from the
    A-1-3-16)          fields in the record just read available for access as elements in the myFields string array
    A-1-3-17)     END WHILE
    A-1-3-18)     CALL method currentAcccount.getBalance and ADD its return value to sumOfEndingBalances
    A-1-3-19)     CALL method printEndingBalance with the following argument list: currentAccount
    This private static method has no return value, and has three parameters: currentAccount of type CheckingAccountPlus, myFile of type MyCsvFile and myFields of type String array.
    A-1-4-01)     CALL method currentAcccount.getBalance and ADD its return value to sumOfBeginningBalances
    A-1-4-02)     CALL method printBeginningBalance with the following argument list: currentAccount
    A-1-4-03)     CALL method myFile.readARecord, which reads the 1st record after the Balance record (a deposit or withdrawal) for the current customer
    A-1-4-04)     CALL method myFile.getCsvRecordFieldArray and ASSIGN its return value to myFields, a String array. This makes the values from the
    A-1-4-05)          fields in the record just read available for access as elements in the myFields string array
    A-1-4-06)     WHILE (myFile.getEofFound() IS FALSE AND currentAccount.getAccountId().equals(myFields[indexForAccountId]))
    A-1-4-07)          IF (myFields[indexForRecordType].equals(recordTypeForDeposit))
    A-1-4-08)               CALL method handleDeposit with the following argument list: currentAccount,
    A-1-4-09)                    Double.parseDouble(myFields[indexForDepositAmount]
    A-1-4-10)          ELSE
    A-1-4-11)               CALL method handleWithdrawal with the following argument list: currentAccount,
    A-1-4-12)                    Double.parseDouble(myFields[indexForWithdrawalAmount]
    A-1-4-13)          END IF
    A-1-4-14)          CALL method myFile.readARecord, which reads the next deposit or withdrawal record, if any, for this customer
    A-1-4-15)     CALL method myFile.getCsvRecordFieldArray and ASSIGN its return value to myFields, a String array. This makes the value from the
    A-1-4-16)          fields in the record just read available for access as elements in the myFields string array
    A-1-4-17)     END WHILE
    A-1-4-18)     CALL method currentAcccount.getBalance and ADD its return value to sumOfEndingBalances
    A-1-4-19)     CALL method printEndingBalance with the following argument list: currentAccount
    This private static method has no return value, and has two parameters: currentAccount of type CheckingAccount and amount of type double.
    A-1-5-01)     ADD amount TO sumOfDeposits
    A-1-5-02)     CALL method currentAccount.makeDeposit, passing it the following arguments: amount
    A-1-5-03)     DISPLAY the deposit line using the following arguments: amount
    This private static method has no return value, and has two parameters: currentAccount of type CheckingAccountPlus and amount of type double.
    A-1-6-01)     ADD amount TO sumOfDeposits
    A-1-6-02)     CALL method currentAccount.makeDeposit, passing it the following arguments: amount
    A-1-6-03)     DISPLAY the deposit line using the following arguments: amount
    This private static method has no return value, and has two parameters: currentAccount of type CheckingAccount and amount of type double.
    A-1-7-01)     IF (currentAccount.makeWithdrawal(amount) IS TRUE)
    A-1-7-02)          ADD amount TO sumOfWithdrawals
    A-1-7-03)          DISPLAY the withdrawal line using the following arguments: amount
    A-1-7-04)     ELSE
    A-1-7-05)          DEFINE variable overdraftFee of type double and ASSIGN it the value returned from a call of method currentAccount.getOvedraftFee
    A-1-7-06)          ADD overdraftFee TO sumOfFees
    A-1-7-07)          ADD amount TO sumOfOverdrafts
    A-1-7-08)          DISPLAY the overdraft line using the following arguments: overdraftFee, amount
    A-1-7-09)     END IF
    This private static method has no return value, and has two parameters: currentAccount of type CheckingAccountPlus and amount of type double.
    A-1-8-01)     IF (currentAccount.makeWithdrawal(amount) IS TRUE)
    A-1-8-02)          ADD amount TO sumOfWithdrawals
    A-1-8-03)          DISPLAY the withdrawal line using the following arguments: amount
    A-1-8-04)     ELSE
    A-1-8-05)          DEFINE variable creditCardAdvance of type double and ASSIGN it the value returned from a call of method
    A-1-8-06)               currentAccount.getCreditCardAdvance
    A-1-8-07)          ADD creditCardAdvance TO sumOfCreditCardAdvances
    A-1-8-08)          ADD currentAccount.getActualWithdrawal() TO sumOfWithdrawals
    A-1-8-09)          DISPLAY the credit-card-advance line using the following arguments: currentAccount.getActualWithdrawal(),creditCardAdvance
    A-1-8-10)     END IF
    This private static method has no return value, and has one parameter: currentAccount of type CheckingAccount.
    A-1-9-01)     DISPLAY the beginning balance line using the following arguments: currentAccount , currentAccount.getAccountId(),
    A-1-9-02)          currentAccount.getAccountType() and currentAccount.getBalance()
    This private static method has no return value, and has one parameter: currentAccount of type CheckingAccountPlus.
    A-1-10-01)     DISPLAY the beginning balance line using the following arguments: currentAccount , currentAccount.getAccountId(),
    A-1-10-02)          currentAccount.getAccountType() and currentAccount.getBalance()
    This private static method has no return value, and has one parameter: currentAccount of type CheckingAccount.
    A-1-11-01)     DISPLAY the ending balance line using the following arguments: ?Account Totals,? currentAccount.getAccountId(),
    A-1-11-02)          currentAccount.getAccountType(), currentAccount.getBeginningBalance(), currentAccount.getDeposits(),
    A-1-11-03)          currentAccount.getWithdrawals(), currentAccount.getFees(), currentAccount.getBalance() and
    A-1-11-04)          currentAccount.getOverdrafts(), ?? *?

    You're calling a bunch of methods and constructors with the wrong arguments, or missing arguments. Take the errors one by one, and look at the method you're being told you're calling, and check that the arguments you're using are right

  • Need help writing a method..

    Hi, I am new to Java and I have a little problem with this statement:
    a soldTickets(int num) method that records the fact that the specified number of tickets have been sold at this booth.
    Basically I only wrote this part:
    public int soldTickets(int num)
    return num;
    I wonder if it is correct, if not what value should I return?

    i don't think tht shud correctly work. u just define a static variable num in the class. and just perform >num++ in the function and when the program executes u will get to know how many tickets r sold after >printing num. if u do this there is no need of any parameter to be passed in the function because u have >already defined it in the class.
    Bye ! i hope it works What happen when he want to enter 50 ticket at a time..then using ur code he needs to call that method 50 times.
    Sounds like you need a Booth object which has a variable - int totalTicketsSold;
    and a method - public void soldTickets(int num)
    in the body of the method num is added to totalTicketsSold; public int soldTickets(int num)
    totalTicketsSold = totalTicketsSold + num;
    return totalTicketsSold;
    I think this match ur requirment best...

  • Need Help on CallServer Method

    I am implementing a PM for my custom control. I have two requirements for Call Server which I am not sure how to give input parameters. I am not able to find help in other controls implementations.
    1.I need to call a method (GetCustomCtrlInfo) in applet using Call server. But this method takes two parameters out of which one is a reference which contains the output value required to render my control. I tried using the ouput property set from the Callserver. But it donot contain the reference property set. How can I achieve this.
    ErrCode CSSSWEFrameOfferFile::GetCustomCtrlInfo (CSSSWEFieldItem* pFieldItem, CCFPropertySet& psCustCtrlProp)
    2.I need to call Applet method in which it is access Web Engine HTTP TXN ‘s GetAllRequestParameters. How can I set it while calling the CallServer method form my PModel.
    DOCHILD (m_pFrameMgr->GetModel (), GetService(SStext("Web Engine HTTP TXN"), pHttpService));
    DOCHILD (pHttpService, InvokeMethod (SStext("GetAllRequestParameters"), inputs, outputs));
    Is there any argument in input property set that can be used to achieve the both of above?

    Hi
    I was able to write the function using recursion (thanks a lot !!!), and its tested to be correct. Now , i am able to get the correct element given the index and also the stack remains the as it is upon return to the function call.
    But, if the index is out of bound , that is if its not in the stack , then i am supposed to throw an exception (any exception will do) without altering the original stack. I was thinking of using stack.size() check at the begining f the program to throw the exception, but then , i i cant use the size() method here , so in this case, is there any way i can accomodate the exceptional condition with the oroginal stack intact ? because , i tried a few ways but then everytime the stack is beign destroyed if i throw the exception...
    any pointer will be appreciated!
    here is my function
    int getStackElement( Stack<Integer> stack, int index ) throws Exception
              int res = 0;
              int value = 0;
              int count = index;
              if(count == 0){                    
                        return stack.peek().intValue();
                   }else {
                        value = stack.pop();
                        res = getStackElement(stack, --count);
                        stack.push(value);
                        return res;
         

  • Help with calling methods of different classes

    I have two classes. In class A I read a line of input from the console
    myVar= x.readLine();
    then I call a method of the same class (A)
    methodA(); i get NULLPOINTEREXCEPTION here
    in this method I wish to call another method but this time of class B so I create an instance of class B in class A
    private B instanceVar;
    and then proceed to create the method call to class B
    instanceVar.methodB(myVar); i get NULLPOINTEREXCEPTION here
    What am I doing wrong?

    What am I doing wrong?Not posting a short snippet of java code that demonstrates your problem.
    In class A I read a line of input from the console
    myVar= x.readLine();
    How is that related to the NPE's?
    then I call a method of the same class (A)
    methodA(); i get NULLPOINTEREXCEPTION hereSomething is probably wrong in methodA(). Impossible to say anything more with the information given.
    private B instanceVar;
    and then proceed to create the method call to class B
    instanceVar.methodB(myVar); i get NULLPOINTEREXCEPTION hereDid you ever assign instanceVar to an actual object with something like instanceVar = new B(); ?

  • I need help--get easy points for this one!

    my video will not finish downloading...it has stopped. please answer a reply... i really need help! i purchased a t.v. episode from the iTunes store and it has stopped downloading...but it has downloading partially, just not completely. please help!

    on itunes. it is downloading on itunes...or at least it was. but its stopped.

  • Need help getting Main method to work...

    Hello everyone, I have a problem, I have a GUI that I need to run (it compiles fine, but will not run.) I am very new to Java and programing in general so go easy on me. I think I am just missing something simple here. I am going to post the basic code and see if you all can help...the issue is in written in red to help you identify my problem...
    public class LagersGUI extends JFrame implements ActionListener,Serializable
    {color:#0000ff}private {color}JTextArea {color:#339966}textArea{color};
    {color:#0000ff}private {color}JButton {color:#339966}start,
    next,
    previous,
    last;{color}
    JLabel {color:#339966}imageLabel{color};
    {color:#0000ff}private static{color} LagersAddInfo {color:#339966}inv{color} = {color:#0000ff}new {color}LagersAddInfo();
    {color:#808080} /**
    * @param arg0
    * @throws HeadlessException
    */{color}
    {color:#0000ff}public {color}LagersGUI( String arg0 ) {color:#0000ff}throws {color}HeadlessException
    {color:#0000ff}super{color}( {color:#ff9900}"Inventory GUI" {color});
    {color:#339966}textArea{color} = {color:#0000ff}new {color}JTextArea( 800,800 );
    JScrollPane scrollPane = new JScrollPane( {color:#339966}textArea{color} );
    textArea.setEditable( {color:#0000ff}false {color});
    scrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS );
    scrollPane.setPreferredSize( new Dimension( 600, 100 ) );
    JPanel cp = new JPanel();
    cp.setSize( 400, 100 );
    cp.setLayout( new BorderLayout() );
    cp.add( scrollPane,BorderLayout.{color:#339966}CENTER{color} );
    JPanel buttonPanel = new JPanel();
    JPanel buttonPanel1 = new JPanel();
    {color:#339966}start{color} = new JButton( {color:#ff9900}"Start"{color} );
    {color:#339966}start{color}.addActionListener( {color:#0000ff}this {color});
    {color:#339966} next{color} = new JButton( {color:#ff9900}"Next" {color});
    {color:#339966} next{color}.addActionListener( {color:#0000ff}this {color});
    {color:#339966}previous{color} = new JButton( {color:#ff9900}"Previous"{color} );
    {color:#339966} previous{color}.addActionListener( {color:#0000ff}this {color});
    {color:#339966} last{color} = new JButton({color:#ff9900} "Last"{color} );
    {color:#339966} last{color}.addActionListener( {color:#0000ff}this {color});
    buttonPanel.add( {color:#339966}start {color});
    buttonPanel.add( {color:#339966}next {color});
    buttonPanel.add( {color:#339966}previous {color});
    buttonPanel.add( {color:#339966}last {color});
    cp.add( buttonPanel,BorderLayout.{color:#339966}SOUTH {color});
    cp.add( buttonPanel1,BorderLayout.{color:#339966}NORTH {color});{color:#999999}///NewInventory_Test/logo.gif{color}
    java.net.URL u = {color:#0000ff}this{color}.getClass().getClassLoader().getResource({color:#ff9900}"\\NewInventory_Test\\logo.gif"{color});
    ImageIcon icon = {color:#0000ff}new {color}ImageIcon(u);
    {color:#339966}imageLabel{color} = new JLabel( {color:#ff9900}"Inventory View"{color}, icon, JLabel.{color:#339966}CENTER {color});
    cp.add({color:#339966} imageLabel{color},BorderLayout.{color:#339966}WEST{color} );
    {color:#0000ff}this{color}.setContentPane( cp );
    {color:#0000ff}this{color}.setContentPane( cp );
    {color:#0000ff}this{color}.setTitle( "Inventory Program IT 215" );
    {color:#0000ff}this{color}.setDefaultCloseOperation( JFrame.{color:#339966}EXIT_ON_CLOSE{color} );
    {color:#0000ff} this{color}.{color:#339966}textArea{color}.setText({color:#339966}inv{color}.getStart());
    {color:#0000ff} this{color}.setSize(200, 200);
    {color:#0000ff}this{color}.pack();
    {color:#0000ff}this{color}.setVisible( {color:#0000ff}true {color});
    @Override
    {color:#0000ff}public void{color} actionPerformed( ActionEvent e )
    // TODO Auto-generated method stub
    {color:#0000ff} if {color}( e.getActionCommand().equals({color:#ff9900} "Start"{color} ) )
    textArea.setText( {color:#339966}inv{color}.getStart() );
    {color:#0000ff}if {color}( e.getActionCommand().equals( {color:#ff9900}"Next" {color}) )
    textArea.setText({color:#339966}inv{color}.getNext());
    {color:#0000ff}if{color} ( e.getActionCommand().equals( {color:#ff9900}"Previous" {color}) )
    textArea.setText( {color:#339966}inv{color}.getPrevious() );
    {color:#0000ff} if{color} ( e.getActionCommand().equals( {color:#ff9900}"Last"{color} ) )
    textArea.setText({color:#339966}inv{color}.getLast());
    {color:#0000ff}public static {color}LagersAddInfo getInv()
    {color:#0000ff}return{color:#339966} {color}{color}{color:#339966}inv{color};
    {color:#0000ff}public static void{color} setInv( LagersAddInfo inv )
    LagersGUI.{color:#339966}inv {color}= inv;
    {color:#808080} /**
    * @param args
    */{color}
    {color:#0000ff}public static void {color}main( String[] args )
    LagersGUI {color:#ff0000}_inventory_ {color}= {color:#0000ff}new {color}LagersGUI( {color:#ff9900}"Inventory"{color} );{color:#ff0000}//** here's the part I'm having trouble with...inventory is an * unused variable. What other way could I get {color:#000000}main{color} */ method to work?{color}
    }

    This forum can format your code for you and make it easier to read. Simply click the CODE button and two tags will appear. Then paste your code in between the tags. Important, copy code form your source not first post.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • My iPod Nano no longer work, just appearing a complete white screen

    e can not turn it on

  • HOW DO I  RUN A UNIX BASH SCRIPT FROM JAVA??

    HI. Here's a tricky little problem i have. There's a unix bash script that has some commands in it, that manipulate a file. It appends a certain string variable to a file called users. The users file is an ordinary text file. I know this script to wo

  • Connecting to my macbook pro is impossible

    I have been trying for 5 days to connect my macbook air 13" mid 2011 to my macbook pro 13" mid 2012 using thunderbolt cable and several times it connects and the disconnects on its own and now not even that. Both macs are running Mavericks.

  • Getting result of stored functions in UCM components

    Hi, I have to create UCM component that executes function stored in DB and somehow "inject" it's return value to iDoc. How can I get return value of DB stored function? I managed to run the function, but I can not get it's return value. The only docu

  • "Import from camera" doen't work

    I want to import movies from mi iPhone 4S and the "import from camera" option doesn't work. When I click de button (or pressing cmd+I, or going to archive > import from camera) the arrow turns to the colored beach ball of death and the aplication doe