Very New to BlueJ could please help with Budgie problem?

Here is the code.
I had to remove the field "empty" because it is not strictly necessary.
So I have to remove field "empty" and add code so that the fuctionality is the same. How do I do this?
* A cage for budgies to live in.
* A maximum of one budgie can live in cage
* @author (Jacqui Whalley)
* @version (v0.2)
public class Cage
    // Instance variables
    private Budgie myBudgie; // The budgie that lives in the cage
    private boolean empty;   // True if there is no budgie in the cage
     * Constructor for objects of class Cage
    public Cage()
        empty = true;
        myBudgie = null; 
     *  Add a budgie to the cage.
     *  @param bird, the budgie to add to the cage
    public void addBudgie(Budgie bird)
        // Can only have one budgie
        if(empty)
            myBudgie = bird;
            empty = false;
        else
            System.out.println("Sorry no more room in the cage, it is already occupied");
     * Remove the budgie - eg if it has died.
    public void removeBudgie()
        // Can only remove if there is a budgie there
        if(!empty)
            myBudgie = null;
            empty = true;
     * Returns the cage's budgie (which my be null).
     * @return The budgie that lives in the cage
    public Budgie getBudgie()
        return myBudgie;
     * Returns true if the cage is empty.
     * @return the emptiness of the cage
    public boolean isEmpty()
        return empty;
}

Hi,
why you want to remove the field "empty". In my point of view is this approach to the Budgei problem good.
L.P.

Similar Messages

  • [ETL]Could you please help with a problem accessing UML stereotype attributes ?

    Hi all,
    Could you please help with a problem accessing UML stereotype attributes and their values ?
    Here is the description :
    -I created a UML model with Papyrus tool and I applied MARTE profile to this UML model.
    -Then, I applied <<PaStep>> stereotype to an AcceptEventAction ( which is one of the element that I created in this model ), and set the extOpDemand property of the stereotype to 2.7 with Papyrus.
    -Now In the ETL file, I can find the stereotype property of extOpDemand as follows :
    s.attribute.selectOne(a|a.name="extOpDemand") , where s is a variable of type Stereotype.
    -However I can't access the value 2.7 of the extOpDemand attribute of the <<PaStep>> Stereotype. How do I do that ?
    Please help
    Thank you

    Hi Dimitris,
    Thank you , a minimal example is provided now.
    Version of the Epsilon that I am using is : ( Epsilon Core 1.2.0.201408251031 org.eclipse.epsilon.core.feature.feature.group Eclipse.org)
    Instructions for reproducing the problem :
    1-Run the uml2etl.etl transformation with the supplied launch configuration.
    2-Open lqn.model.
    There are two folders inside MinimalExample folder, the one which is called MinimalExample has 4 files, model.uml , lqn.model, uml2lqn.etl and MinimalExampleTransformation.launch.
    The other folder which is LQN has four files. (.project),LQN.emf,LQN.ecore and untitled.model which is an example model conforming to the LQN metamodel to see how the model looks like.
    Thank you
    Mana

  • Please help with slideshow problems!

    Am using Photoshop Elements 8 and trying to make a slideshow. Have tried 4 times now and keep ending up with same problem, cannot reopen project to continue edititing.  Won't show up in orginizer and when I find on harddrive and try to open get message " wmv file cannot be opened".  How can I save a
    slideshow inprogress and be able to reopen and continue to edit and make slideshow?  I want to thank anyone who can help me with this in advance as I
    have gotten so frustrated that I want to just scream.
    Thanks

    Thanks for the help, thought I had done so but maybe not.  Anyway will have another go at it, now may I ask another
    question?  I am trying to add audio to slideshow.  I have some music I purchased thru amazon as mp3 files but I get
    message no codec and when I try to add wmv I get same message.  What type of file do I need and how can I add
    multiple songs to one slideshow.   I have one little wmv file that will go in, but it just replicates itself multiple times until
    it fills slide show. 
    Thanks again, sorry to be a bother, but this thing is driving this old man crazy.
    Date: Sun, 26 Dec 2010 20:34:32 -0700
    From: [email protected]
    To: [email protected]
    Subject: Please help with slideshow problems!
    You need to save the slideshow project in order to be able to go back later and make changes or additions to an existing slideshow . The wmv file is a final output format.
    Now you are most probably using only the Output command: that is what makes the wmv file.
    You should also do the Save Project command. (and I make it a practice to do the Save Project command before I do the Output command).
    If you look at the Elements Organizer 8 Help, there is a topic on "Create a slide show".
    -- Very close to the beginning of that topic is a screen shot of the Sldie Show Editor screen,
    -- The bar below the usual menu bar is labeled with a "B" and called the Shortcuts bar.
    -- The 1st entry on that Shortcuts bar is "Save Project"
    It is the Save Project command that saves the information about which photos, audio, etc you placed in that specific slide show so that you can come back again to do subsequent editing.  Save each Project with a unique name.
    After completing the Save Project command, you shoud see an "icon" in the Organizer for that slide show.
    Note:  you must also keep the photo files and audio files which you have used in this slide show: you can't delete them because the project file does NOT contain a copy of the photos, it only has the identification and folder location of the photo and audio files.
    >

  • You cannot embed this FLV file because it consumes too much memory. Could sb help with this problem?

    You cannot embed this FLV file because it consumes too much memory. Could sb help with this problem?

    The error is pretty concise. Do you know how to re-encode the video smaller?

  • My Ipad reboots over and over again could someone help with my problem?

    My Ipad reboots over and over again, could someone help with my problem?

    Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo.

  • Please help with start problem of my new X61s

    I baught my X61s 2 weeks ago. It was received with vista home installed. I downgraded it to XP myself 1 week ago and it was working very well. Today, when I turned on the machine, nothing appeared on the screen, and I only hear about 7 beeps. I tried to turn off and turn on the machine several times, but no difference. I don't know what happen.
    Please help me! Thanks.

    Per the magic beep decoder ring that might mean bad DIMM or system board.
    I don't work for Lenovo. I'm a crazy volunteer!

  • Please help with AcroIEHelper problem

    Hello,
    I had perfectly running laptop. Now, with no reason every time I turn on my laptop I get a messege that Windows Installer is preparing to install something. Then Installer asks me to insert a disc with Adobe Acrobat 7.0 Pro. When I insert the disc installer tells me that it can not access a file. Exactly:
    Adobe Acrobat 7.1.0 Professional
    Error 1304: Error writing to file C:\Program Files\Adobe\Acrobat 7.0\ActiveX\AcroIEHelper.dll.
    Verify that you have access to that directory.
    I checked that directory and did not find such file. Sometimes, this messege appears when I try to open C: or folders on my Desktop but not always. Once it showed up when I tryed to start IE. Ater I uninstalled Adobe Acrobat this messege stopped showing up. But when I reinstalled Adobe Acrobat it started again.
    I have tryed almost every anti-malware I could find - McAfee, Spybot, Spyware Doctor, Malwarebyte's Anti-Malware, Superantispyware, AVG 8.5, Dr. Web - all these programms I ran in both normal and safe modes. I even went to BIOS Setup and returned to factory settings. Nothing helped. I went to malware forum and people did not find any malware in my logs.
    Then, I installed WinPatrol that seems to be able managing startup programs. After I desabled SC-Acrobat.exe and Adobe Gamma Loader I do not have this annoying Windows Installer for Adobe Acrobat warning any more when Windows starts. But it still shows up often, but not always when I open C: or folders on my Desktop. I have Windows Vista Home.
    So could you please help me with this problem? Thank you.

    MamaDragonBoy wrote:
    It's already set to "mixed" wireless b and g... should I try setting it to all g?  Both my laptop and my husband's are "g"
    setting it to g certainly wont hurt anything.

  • I have just started using WD external hard drives, I use it to save my movies and music on. On more than one occasion, when I connect to my MacBook it erases everything on had on there. Can someone please help with this problem?

    I have just started using WD external hard drives, I use it to save my movies and music on. On more than one occasion, when I connect it to my MacBook it erases everything I had save on the hard drive. Can someone please help me with this problem? I am super tired of having to put all of my movies and music on the hard drive just to have it erased again. The products I am using are WD 4TB My Book and 2 TB My Passport external hard drives. When it happens, there is always an icon that reads, EFI, along with the My Book icon. Thank you for your assisstance.

    dwgar1322 wrote:
    I have just started using WD external hard drives, I use it to save my movies and music on. On more than one occasion, when I connect it to my MacBook it erases everything I had save on the hard drive. Can someone please help me with this problem? I am super tired of having to put all of my movies and music on the hard drive just to have it erased again. The products I am using are WD 4TB My Book and 2 TB My Passport external hard drives. When it happens, there is always an icon that reads, EFI, along with the My Book icon. Thank you for your assisstance.
    Yes, you have WD software installed  REMOVE IT !! 
    WD has warned its customers about their huge mistake that their software doesnt work on Mavericks and causes data loss.
    (also dont use WD drives anymore)
    Read all about it here:
    https://discussions.apple.com/thread/5475136?start=255&tstart=0
    See their website on removing the destructive WD software here:
    http://community.wd.com/t5/External-Drives-for-Mac/External-Drives-for-Mac-Exper iencing-Data-Loss-with-Maverick-OS/td-p/613775
    Western Digital External Hard Drives Experiencing Data Loss On OS X Mavericks
    http://www.cultofmac.com/252826/western-digital-external-hard-drives-experiencin g-data-loss-on-os-x-mavericks/

  • Please help with internet problems

    Hi
    I have just started having problems with my blackberry curve. When i go to internet and click on my bookmarks it opens up front page fine but when i try to click on pages to connect to from front page it kicks me out straight to bookmarks page. Please help ????????????> this has only started in last few days i.e i go to sky sports which it opens then trying to click on an item to read it kicks me straight to bookmarks page????????

    Hi cp70uk
    Welcome to BlackBerry Support Forums
    Have you try Clearing your device Browser data ,you can try this and see if that helps ,For that Open your Browser > Press  the Menu key > Scroll down to Clear Browser Data ( Mark all fiels ) then Clear Now .
    Then perform a Battery Pull Restart like this device POWERED ON remove the battery wait for a min. then reinsert it back ,after reboot see if problem resolves.
    Click " Like " if you want to Thank someone.
    If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it.

  • PLEASE HELP WITH BATTERY PROBLEM!!

    I recently swicthed from the 8830 which was a wonderfull phone. MY curve from sprint, 8330 is dead every day by 5 pm. I already exchanged the phone and had the battery replaced (third battery) I used my 8830 with the same applications and the most it would be by like 50-70 percent.  I dont know what to do. The curve is SUPPOSED TO  get better battery life! but actually is not. Its become a non realiable phone for me. Its still under my 30 days. Even though i already swaped it once. I do not want to get rid if this phone. I love the blackberry i just need the battery to last me either the same or better than the 8830 as blackberry promised....
    I have read forums in closing the applications but even when i do its still the same. I occasionally do get the hour glass problem and it does lag quite a bit.  Does any one know of a battery issue?? Has to be???
    I let it die last night and recharged it completely - as some of you recommended. I will try it today but my hopes arent to high ....
    Please help.
    Thank you 

    Hi,
    Excellent Post by JSANDERS
    http://www.blackberrynews.com/2008/05/20/battery-use-tips-for-your-maximum-battery-life/
    Thanks
    If you need more info please ask!  If not please resolve the thread using the options by the Kudos’ star, Just place the check in the Post that answered your question, Thanks  
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

  • Please help with some problems with my N96

    Hi there,
    I have spent a fair bit of money on my Nokia N96 and unfortunately it is out of its warranty etc.And I have few issues with it.
    So can anyone advise me as to how about I can overcome some issues:
    Firstly, in my message inbox only the numbers display instead of the names (e.g.. +447770260.. Instead of Peter), has anyone had this issue or can help with this? I have gone into the message setting and nothing sticks out and says click me for number or name to be displayed.
    Secondly, the vibrating device doesn't seem to work at all some days and other days it seems fine? Is this a common fault or is it my phone. Also, is there anywhere on the phone to adjust the vibrating force which maybe getting in the way?
    Many thanks for any advise or for merely looking, and grateful for any help.
    Adam  

    /discussions/board/message?board.id=smartphones&message.id=112590&query.id=115949#M112590
    read the above thread in regards to the contacts issue. it is a common issue for the s60 phones no fix as yet and it has been few years now.
    there is no way you can adjust the vibration force. its either on or off. the vibration should work at all times if you have it set to work. it should not be random. you might want to take it to nokia care for them to have a look at it despite the fact that it is out of warranty.  
    You know what I love about you the most, the fact that you are not me ! In love with technology and all that it can offer. Join me in discovery....

  • Please help with namespace problem

    Hello,
    I am trying to display a gif image an I have a namespace problem.
    Here is my xml document:
    <?xml version='1.0'?>
    <?xml-stylesheet type="text/xsl" href="authors.xsl"?>
    <authors>
    <author>
    <name>Mike Galos</name>
    <nationality>French</nationality>
    </author>
    <author>
    <name>Cynthia Randall</name>
    <nationality>Canadian</nationality>
    </author>
    </authors>
    Here is my xsl stylesheet:
    <?xml version='1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="//author">
    <image     xmlns:xlink="http://www.w3.org/1999/xlink"
                   xlink:type="simple"
                   xlink:href="logo.gif"
                   xlink:show="embed"/>
    </xsl:template>
    </xsl:stylesheet>
    I want the browser to diplay the gif image but it is only showing the image icon and not the actual gif image.
    Can anyone please help??
    Thanks in advance,
    Balteo.

    do you use a special browser?
    if not, do you really expect a standard browser to understand this kind of non-HTML image tag?
    <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:show="embed" xlink:href="logo.gif" xlink:type="simple">check HTML 4.0 (http://www.devguru.com/Technologies/html/quickref/html_img.html)
    or XHTML(http://www.devguru.com/Technologies/xhtml/quickref/xhtml_img.html)
    for the correct tag syntax.

  • Please help with a problem I have with Re-Exporting Video

    Hi to all Encore and Premiere users.
    I will try to make this as clear as possible.
    I have made 2 very short movies in Premiere and exported them for use in Encore.
    I have made a project in Encore using both of these short movies on 2 timelines and all is fine.
    I then decided I would like a 30sec introduction to one of them which I have made using After Effects.
    I have imported this short introduction into Premiere and placed it at the beginning of one of the Movies, checked all is well and then Re-Exported it over writing the original file, and all appeared to be OK
    Moving back into Encore I opened the project and previewed this movie but found that 30sec from the end it stopped, checking the end of the timeline I found that approx 30sec of video and audio was missing.
    Encore would not allow me to delete the movie, or import it as a new asset.
    I went back into Premiere and Exported again and every frame appeared to go through OK.
    But found the same result in Encore.
    Can anyone help me with ideas of what could have gone wrong?
    Best Regards
    Allan

    Hi Jo
    I tried that, result was No Video, only Audio until I paused then a still picture appeared. Start to play again, No Video,only Audio, very strange.
    In the end I had to delete everything with regard to this clip, and save project.
    Opened project again and imported Audio and Video, set up new time line and all is working fine now.
    On refection it would appear that the 30sec into I introduced at the beginning of the film knocked of 30sec at the end of the Video for reasons which are totally unknown to me.
    All is well now and thank you for your help.
    Best Regards
    Allan

  • Please help with driver problem trying to reinstall windows 7

    Hi, product is HP 655 Notebook pc operating system windows 7 however due to my daughters negligence (dont know exactly what, do know she very rarely if ever shut it down properly) the computer would go on but but only to black screen stating after general info at top (PXE-E61: Media test failure, check cable) next line (PXE-MOF: Exiting PXE ROM), on last line (No bootable device -- insert boot disk and press any key). dint have the boot disc only the product key so downloaded windows 7 home premium, put it on disc to start again.  While trying to install Win 7, I get past a couple of screens in (collecting information) then I get stuck at a "Select the driver to be installed." screen. there is nothing in the box to choose just a statement  "No signed device drivers were found. Make sure that the installation media contains the correct drivers, and then click OK.". Im certainly no expert but can and have followed instruction just dont know if i'm missing something, any help in this matter would be very much appreciated and thank you in advance!

    Hi del922,
    Your HP 655 is a commercial product and to get your issue more exposure I would suggest posting in the commercial forums. Here is a link to the Commercial Notebook forum.
    Thank you,
    Please click “Accept as Solution ” if you feel my post solved your issue.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Thank you,
    BHK6
    I work on behalf of HP

  • Please help with audio problems, thanks!

    Hi, I'm relatively new to DVD studio Pro and so far the manual has been useful but i've run into some sound related problems. I'm a composer/sound designer and this DVD is to be my reel so these are fairly integral issues to its success.
    First, I want to add a sound effect to each of the roll over states, so one sound for the "over" and one sound for the "down" state. Currently i can only add audio as the backing track for each menu.
    Second, whilst most of the items on the dvd are movies that include my music, I also want to have a page purely of audio tracks which play when pressed without changing the page. How can i do this? The only DVD i've seen this done on is "The Thin Red Line" extras, promoting the soundtrack to the film.
    Thanks.

    Welcome to the forum/discussions CC!
    Sorry to have to inform you, but unfortunately layered menus aren't supporterd with audio in DVDSP, and technically what you're attempting is a layered menu-type function - although it just may be possible with scripts, I doubt it.
    Your second request can be done however and there's several ways to go about doing it.
    I like DVD@ccess but others would recommend a method of simply placing the audio files in the built file of the DVD making them accessible to users.
    Another method I could suggest is to make a menu page exactly like the one you want to look the same and have the song you'd like to play as the music track for that duplicated-menu in question - set the target of the link for the song in the menu to go to the menu that has that song as the music track. Repeat that for the number of songs you'd like to have this feature.

Maybe you are looking for