Can this work?

Will this piece of code create a new object accordingly? I was wondering how to set the methods and the variables properly.
     AirplaneList plane = new AirplaneList();
     plane.add(); //Add planes to list
     plane.remove(); //Remove planes from list
     plane.empty();
     plane.full();
     plane.item();
     plane.total();
     //creating a new list
//if(!plane.isFull());
//plane.add("Boing 747");
//plane.add("Chesna");
//plane.add("StealthBomber");
     class Airplanelist
     //Attributes of the class
     private boolean isEmpty = true; //change list state
     private boolean isFull = false;
     private int getTotal;
     //Methods of the class
     public void add(String flight);
     //add the plane to a list or array or something
     System.out.println("INSANITY LEVEL APPROACHING CRITICAL HOW TO ADD A PLANE FROM LIST?");
     public void remove(String plane);
     //remove the plane to a list or array or something
     System.out.println("INSANITY LEVEL APPROACHING CRITICAL HOW TO REMOVE A PLANE FROM LIST?");
     //evaulate if list is empty
     public void empty() //List is empty
     isEmpty = true; //list state
     isFull = false;
     System.out.println("Is empty");
     }// empty()
     //evaulate if list is full
     public void full() //List is full
     isEmpty = false; //change list state
     isFull = true;
     System.out.println("Is empty");
     }// full()
     public void item(String int);
     //returns the airplane flight number
     System.out.println("return item number");
     public void total(String int);
     //returns the total number of airplanes on the list
     }//Airplane list class

javac -d D:\Java -g "D:\Virtual worlds\1st Year\Semstair 1\JAVA - Structured Programming\Assignment 2\AirplaneListTester.java"
D:\Virtual worlds\1st Year\Semstair 1\JAVA - Structured Programming\Assignment 2\AirplaneListTester.java:12: cannot resolve symbol
symbol : variable EasyIn
location: class AirplaneListTester
          size = EasyIn.getInt();
^
D:\Virtual worlds\1st Year\Semstair 1\JAVA - Structured Programming\Assignment 2\AirplaneListTester.java:16: cannot resolve symbol
symbol : class AirplaneList
location: class AirplaneListTester
     AirplaneList plane = new AirplaneList();
^
D:\Virtual worlds\1st Year\Semstair 1\JAVA - Structured Programming\Assignment 2\AirplaneListTester.java:16: cannot resolve symbol
symbol : class AirplaneList
location: class AirplaneListTester
     AirplaneList plane = new AirplaneList();
^
3 errors
These are the errors i get when javac compile occurs for the code
import javax.swing.JOptionPane;
class AirplaneListTester
     public static void main (String[] args)
throws java.io.IOException
          char choice;
          int size;
          size = EasyIn.getInt();
     AirplaneList plane = new AirplaneList();
     plane.add(); //Add planes to list
     plane.remove(); //Remove planes from list
     plane.empty();
     plane.full();
     plane.item();
     plane.total();
     //creating a new list
//if(!plane.isFull());
//plane.add("Boing 747");
//plane.add("Chesna");
//plane.add("StealthBomber");
     class AirplaneList
     //Attributes of the class
     private boolean isEmpty = true; //change list state
     private boolean isFull = false;
     private int getTotal;
     private int number;
     //Methods of the class
     public void add(String flight)
     //add the plane to a list or array or something
     System.out.println("INSANITY LEVEL APPROACHING CRITICAL HOW TO ADD A PLANE FROM LIST?");
     public void remove(String plane)
     //remove the plane to a list or array or something
     System.out.println("INSANITY LEVEL APPROACHING CRITICAL HOW TO REMOVE A PLANE FROM LIST?");
     //evaulate if list is empty
     public void empty() //List is empty
     isEmpty = true; //list state
     isFull = false;
     System.out.println("Is empty");
     }// empty()
     //evaulate if list is full
     public void full() //List is full
     isEmpty = false; //change list state
     isFull = true;
     System.out.println("Is empty");
     }// full()
     public void item(int number)
     //returns the airplane flight number
     System.out.println("return item number");
     public void total()
     JOptionPane.showMessageDialog(null, "Returning the total number of planes on the list is " + getTotal);
     //returns the total number of airplanes on the list
     }//Airplane list class
// The code below creates a dialog box for the user to input a choice
     String inputcode;
     inputcode = JOptionPane.showInputDialog("A: add an airplane from the list\n" +
                              "B: remove an airplane from the list\n" +
                              "C: check if the list is empty\n" +
                              "D: check if the list is full\n" +
                              "E: display the list\n" +
                              "F: quit\n" );
     JOptionPane.showMessageDialog(null, "You have chosen choice " + inputcode);
do
          // get choice from user
     choice = inputcode.toUpperCase().charAt(0);
          //choice = (char)System.in.read ();
          System.out.println();
          //process menu options
          switch(choice)
               case 'A':
               case 'a':
                    JOptionPane.showMessageDialog(null, "Case " + inputcode);
                    break;     //done processing case
               case 'B':
               case 'b':
                    System.out.println("Case B") ;
                    break;     //done processing case
               case 'C':
               case 'c':
                    System.out.println("Case C") ;
                    break;     //done processing case
               case 'D':
               case 'd':
                    System.out.println("Case D") ;
                    break;     //done processing case
               case 'E':
               case 'e':
                    System.out.println("Case E") ;
                    break;     //done processing case
               case 'F':
               case 'f':
                    System.out.println("Case F") ;
                    break;     //done processing case
               default:
                    System.out.println("Invalid entry");
     }while (choice!= 'F' ||
     choice!= 'f' );
     System.exit(0);
I am aware Java is case-sensitive i have corrected the error. From what I have read a constructor initiates an object with a certain set of values for its variables/attributes. However it will not return a value? If there is no constructor present then java automatically assigns "false" values to the variables?
Learning is such a painful process. The coursework that has been set to me is to develop a "AirplaneListTester" class that has been partially created. I have already changed the case values from numbers to letters, so that the user will see a menu. It accepts both case-types and any other letter not listed will create an invalid response. This project appears very similar to the java cyberpet.
This is harder though because I have never dealt with more than two boolean conditions, i.e sleeping or eating. The user is to enter a flight number into the "add" plane menu, however I am not sure how to add planes let alone remove them yet, as well as print out all of the planes on the list and check to see how many there are already there.
EasyIn.getint method = size and size is an integer variable.

Similar Messages

  • Find_report_object('rp2rro') how can this work?

    Hi
    I've spent a long time looking thru metalink (now Support) at the various posts and documents on calling reports from forms using the run_report_object that the translator replaces run_product with, and here and I'm frankly still looking for direction .
    This code is in rp2rro.pll and of course dies, as there is no rp2rro report
    rp2rroNodeId                Report_Object     :=find_report_object('rp2rro');
    I have a menu that calls something called execute_report with just a report name (e.g. end_month_report). execute_report is in a user library and contains a call to rp2rrro. It looks like this
    PROCEDURE execute_report(i_report IN VARCHAR2) IS
    -- Code modified by the Forms Migration Assistant
    -- 11-Jan-2011 01:58 PM
    BEGIN
    SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'BUSY');
    RP2RRO.RP2RRO_RUN_PRODUCT(REPORTS, i_report, SYNCHRONOUS, RUNTIME, FILESYSTEM);
    SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
    END;
    Can anyone suggest a way to make this work without modifying the forms?
    Looking at Rp2rro, it uses rp2rroNodeId throughout..
    Thanks for any suggestions

    Well almost a year later, the dummy form solution has been working well with 11GR1, but I have some issues understanding how to make the dummy form call reports using parameters passed in the rp2rro call using this approach
    If a form calls the dummy form with a parameter list containing e.g. start_date, end_date etc then the problem is that the dummy form doesn't have those parameters defined because it can be called from many different forms each with its own set of parameters.
    As I read in the 6i doc "+When passing the default parameter list as well as any other parameter list, make sure that every parameter exists with the same name in the called form"+ which doesn't work as the dummy form doesn't have those parameters defined.
    I'm trying to centralize all the rp2rro report invocations so that developers don't have to add the web.show_document and the hidden values and the rest of that logic to bring a PDF form back into the web browser
    I'm trying out a number of things but would be interested if anyone has any comments..

  • TV sideways (portrait), iPad portrait, HDMI out - can this work?

    I'm using either VGA adapter or HDMI adapter ... with iPad 3.
    I'd like to get my TV (which I rotate 90 degrees so that it's effectively a 'portrait' display) to display iPad as shown below (iPad held portrait, TV effectively portrait):
    (attached is a photo of a 'mock-up' of what I hope to do)
    Can this be done? 
    I usually get this instead (which I *don't* want):
    I want to get the FIRST image (top of this note), not the 2nd.  I want to maximize the size
    of the iPad display, by rotating my TV to be in the same orientation as my iPad is held (portrait).
    Any help/ideas?
    Thanks!
    Jim

    .:B:. wrote:If you really want to pimp your setup, you share the database (use a separate MySQL database) and optionally fanart and have each client access them over the LAN. It's pretty cool stuff. I have my desktop (HD6950 GPU, so also XvBA) and AD10 set up like that. It's pure luxury (and it will make a lot of people's jaws drop ). I stop a movie or an ep on my TV, i go to my bedroom and pick up where I left on my desktop.
    Yeah, I've read about this . But I'm (actually, will be when I move ) living in a small apartment (30m^2) so it's really not needed - I plan on watching movies on my TV, not the computer that will be a few meters away .
    I do, however, have all my fanart/cover art/etc. saved locally on the disk with the media, makes scraping so much faster and easier

  • Airport Express, WPS, 802.11n and 7.5.2 firmware - can this work?!

    Can't believe this hasn't happened to anyone else, but I can't find a relevant thread.
    I have a Time Capsule and an Airport Express base station. The Time Capsule was configured as a WDS base station, and the Express as a WDS Relay. The Express is less than a year old, ie 802.11n.
    Everything worked beautifully until firmware upgrade 7.5.2 which self-installed on the Time Capsule just as you would expect - except the relay stopped working.
    I've tried everything I can imagine, but I can't get the two devices to communicate with each other any more (even with the new firmware on the Express). I have read somewhere on the Apple site that WDS "doesn't work" with 802.11n, but this doesn't fully explain how it did work with 802.11n up until the time of the firmware upgrade to put it mildly. And releasing a firmware "upgrade" that stops existing configurations working, without warning, is not really an Apple thing to do.
    One thing I haven't tried is to revert to older firmware; do I really have to do that? Or is there something wrong here please, Apple? Or did I just imagine, for those 9 months, that the relay was working sweetly?!
    Don't know if this is related, but Airport Utility almost consistently fails to see both devices if they are both switched on, but can only see one or the other. Is it possible that the Express has developed a fault?
    Please help; I have an old house and I can't penetrate most of it without my WDS!!

    Might this apply?
    AirPort Firmware Update 7.5.2 does not install on an extended Wi-Fi base station
    http://support.apple.com/kb/TS3433

  • Pricing item 20 based on material of item 10 - can this work?

    I want to determine a price for line item 20 based on the material# of line item 10.
    If item 10 material = 123 and
       item 20 material = abc,
          item 20 price = $100 and because item 10 material = 123, discount = 10%.
    How can I do this?  I'm willing to create a field for the communication structure, but I don't know how it would work.
    Thanks for any help!

    Hi - In order to solve this require 2 steps need to be carried out:
    1 - We need to create  a routine for Alternative Base Value in the pricing procedure assign it to the condition type that you have created.
    2 - You need to also use the higher level item feature in your contract/order to specify which item you will be using as the basis for your discount calculation.
    **Alt Calculation type may not help you. Alt Basetype for Calculation is the key to solving this
    Regards
    Siddharth
    << Moderator message - Point begging removed >>
    Edited by: Rob Burbank on Nov 26, 2010 3:05 PM

  • 2 ipods, 1 library and 2 computers. Can this work?

    ok so i am sure that the answer to this is a no brainer but i dont know it so i need help.
    My sister just bought an ipod nano, which is what I have, and we were wondering if it is possible for her to access the music from my itunes library and download all my music to her ipod. WE think that this will work, but the real question is can we have two ipods sharing one itunes library, and access this one library from two different computers?
    Somebody please help, we are clueless.

    Assuming both computers have Internet access, I would try sharing your iTunes music with the iTunes library on the other person's computer:
    -Go to Edit > Preferences and then click the tab that says Sharing. Check the box that says Share my music.
    - Then, in iTunes on the other computer, go to Edit > Preferences and check Look for shared music within the Sharing tab.

  • Two Ipods for one computer:  Can this work?

    Question:
    My wife has an Ipod nano and my daughter wants one for Christmas. If my daughter hooks hers up to the computer, will it automatically load all the songs in my wifes itunes? Can they keep their songs separate from each others Ipods?
    Thanks in advance for any info.

    Apple has a great iPod website that explains all kinds of things about the iPod. Be sure to take a look there.
    But to answer your question, yes, your daughter and wife can certainly use one computer and two iPods. My wife and I did for about a year. The first question is this - do they share any of the same musical tastes?
    If not, then the easiest solution would be to create an account on your computer for your daughter. She can put her music in that account, keep her own iTunes library, and fill her iPod to her own delight.
    If they do share any musical interests then it will be more economical to use just the one account. Your wife and daughter can create their own individual playlists and set their iPod preferences to sync only the playlists they choose.

  • Timestamp query in partitioned table - can this work?

    Hi,
    I have a table RANGE partitioned by a column named: CREATE_DATE (DATE). Its purpose is to manage the daily create/drop partitions of this table, I do not want to include this column in queries. I do not have an index on this column. We chose DATE for this column because we want to maintain a specific number of days in this table. And when we originally tried to use the STOP_TMSTMP column, TIMESTAMP proved to be unusable for RANGE partitioning.
    There are two other Timestamp columns that ARE used for precise transaction time calculation (STOP_TMSTMP - START_TMSTMP), and included within queries.
    I have an index on the STOP/START_TMSTMP but it is not getting used. And a table scan is occurring. So, finally my main question: How can I make the STOP_TIMESTAMP column index be used in queries against this table? And Is the CREATE_DATE required in a query, or can I safely ignore this column?
    Thanks,
    Mike

    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    "CORE     10.2.0.3.0     Production"
    TNS for Solaris: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Example query:
    select count(*)
    from flow_completion_record
    where stop_timestamp > '03-MAY-10 12.00.01.000000 AM'
    Takes 370 seconds and returns 2.7 million rows.
    Are you smarter than Oracle's optimizer?I will answer this rhetorical question with another question: does anyone really know what the optimizer will do? Or are you just best-guessing?
    Back to the original question: If I use the CREATE_DATE column to RANGE PARTITION this table, can I ignore it for queries in this table when it comes to TIMESTAMP?
    I really want to treat CREATE_DATE like I would an ID primary key column. Its value is set but I do not use it for queries.
    Thanks

  • Exchange and Mail.app 3.1 Can this work?

    I am desperately trying to not have to run a VM Windows machine and am trying to get my email from my exchange server. Is there a tutorial on how to do this somewhere?
    I see the Exchange option when setting up the account but that is where I seem to have problems.
    I get these instruction for Entourage from Intermedia
    When I look at the Mail setup I see OWA settings? What is that? (Outlook Web Access?)
    Message was edited by: thinktwice

    We also use Intermedia.net and I've yet to get mail.app and Exchange to work together. The KB and support offer very little more than what you see posted here already. The "Mail for Mac OSX" are not even close to being accurate for our dedicated hosting plan (we don't have mail.domain.com type names).
    Mail.app doesn't give you much to go on either... I plug in the information and it just never connects or never goes online. If I open up the Activity window I see it try and connect but then just drops the connection. No failed password or other error message.
    Anyone else have any experience with Intermedia or success with Exchange?
    --KD

  • Can this work to backup iPhone...

    I am 3 computers past my last backup in iTunes because my original one kept getting errors. I want to push everything to my computer via my phone. I have all my music saved externally, But I don't want to lose my notes, and preferably data within my apps. I could manually transfer everything, but this could result in a disaster. I was wondering if I backed my entire iPhone to the cloud, could I then pull that to my iTunes account and sync the two devices that way? I really miss having my iPhone synced to my Computer. Btw, it is 32GB iPhone 4, and includes every little bit of that 32GB. So I understand I would have to pay for that data to cloud back up.
    As in, I dont care about my music. I have it all, Its everything else I dont want to lose. Does iCloud do this??
    Thanks!!

    Ahh, I dont use iTunes because it wants to erase my phone's data and sync to my computer. But I dont want to lose the data associated with notes/contacts/apps.
    But your saying that I could use iCloud to back up that data, then use iTunes to wipe my iPhone and by authorizing my computer, it will get all of my app and music purchases back. Then add any CD music from my backups. Then I can use iCloud to reput the notes/contacts/apps data back into my iPhone and this result in the same iPhone but synced to my computer?
    (I have iCloud, but never backed up because I had too much data. But i realized it was mostly pictures. And i can manually back those up, so now I am actually under the 5GB limit I think)

  • Can this work for a chart?

    i want to create a static group
    like
    such that i can see group in report
    1 In Picking
    2 In Packing
    3 In Engraving
    4 In SHipping
    5 etc.
    6
    that group then i can use in chart and create another formula
    to show ship of date

    Hi Paul,
    You can't really create 'static' groups *without evaluating them against a database field value*.
    E.g:
    If {database_field} = <some_value> then 'In Picking'
    else if {database_field} = <some_value> then 'In Packing'
    else 'In Shipping'
    You can then create a group on this formula and even use this in a Chart/Crosstab.
    -Abhilash

  • Can this work as a back up strategy?

    I'm looking into back up for our system. We mainly run Studio 2 Pro apps on a G5 with all the projects and video media on a FW800 connected 1000GB G-RAID. The G5 is also connected to a NAS with a tape facility for off-site back up.
    Time Machine can't see the NAS so I would like to use Disk Utility to clone the G5 HD and the 1000GB G-RAID to the NAS. Does anyone know if this is feasable? I don't mind trying but don't want to waste time if I'm barking up the wrong tree.
    For 'up to the minute' protection against disc faliure I was thinking about either buying another 1000GB G-RAID to enable the creation of a 'mirrored raid set' or would it be possible, and certainly cheaper, to mirror the original G-RAID with a disc in the NAS?...and thereby benefitting from the tape back up. I know I'd have to check that the NAS had a disc the same size.
    Any comments and suggestions would be very appreciated.

    disk utility won't see a NAS. Use [CCCloner|http://www.bombich.com/software/ccc.html] which can back up across a network. However, do understand that backing up 1TB of data over a network will not exactly be very fast.
    Message was edited by: V.K.

  • Can this work as a Switch?

    Can the Air Port Extreame be used as a switch?

    Yes, if it is configured in Bridge Mode.

  • Can this work like google calendar?

    Hi. Just got iCal. I was using google calendar before. I want to have my all my different iCalendars accessible over the internet simultaneously so I can see my color-coded events and I want to be able to edit them and to make new ones. I seem to be able to do that in the address book -- it's accessible on my .mac page. But I don't see iCal on my .mac page. Where is it?
    Thanks,
    -jk

    Hi
    As far as I know, there is no way to edit you calendars over the internet. You can view calendars that you have published, but you cannot edit them, and you get one page per calendar or group of calendars published together. I have found no way to display two different calendars in two different colors on the same webpage.

  • Can this work? DVX help......

    Well I hope I didnt mess up. I shot one full tape 24PN and another in 24PAdvanced on the DVX-100A.
    I searched but was unsure for FCP the workflow I need to make them work on the same timeline for DVD output? I need to work on a 29.97 timeline as some other elements may be used from older video sources.
    Is 24PA capable to work on a 30fps timeline along with 24p normal clips?
    Thank You

    Yeah, just capture it all at 29.97 and you'll be good to go... the pulldown pattern will be different, however look much the same, and in any event, all the material was really shot at 29.97 with different pulldown patterns... so they'll both capture fine at 29.97 and be 29.97 albeit with the two pulldown patterns.
    Jerry

Maybe you are looking for