I need a quick help plz :(

Ok i have a question and i tried to answer it but i still have a few errors..can someone please give me my code back with the correction plz ? :(.... and i need it in less then a day...i know am being pushy am so sorry but i really need it
the Q is
Consider a superclass PurchaseItem which models customer�s purchases. This class has:
-     two private instance variables name (String) and unitPrice (double).
-     One constructor to initialize the instance variables.
-     A default constructor to initialize name to �no item�, and unitPrice to 0. use this()
-     A method getPrice that returns the unitPrice.
-     Accessor and mutator methods.
-     A toString method to return the name of the item followed by @ symbol, then the unitPrice.
Consider two subclasses WeighedItem and CountedItem. WeighedItem has an additional instance variable weight (double) in Kg while CountedItem has an additional variable quantity (int) both private.
- Write an appropriate constructor for each of the classes making use of the constructor of the superclass in defining those of the subclasses.
- Override getPrice method that returns the price of the purchasedItem based on its unit price and weight (WeighedItem), or quantity (CountedItem). Make use of getPrice of the superclass
- Override also toString method for each class making use of the toString method of the superclass in defining those of the subclasses.
toString should return something that can be printed on the receipt.
For example
Banana @ 3.00 1.37Kg 4.11 SR (in case of WeighedItem class)
Pens @ 4.5 10 units 45 SR (in case of CountedItem class)
Write an application class where you construct objects from the two subclasses and print them on the screen.
and i wrote this program
public class PurchaseItem {
     private String name ;
     private double unitprice;
     public PurchaseItem (String name , double unitprice) {
          this.name = name;
          this.uniteprice = unitprice;
     public PurchaseItem() {
          name = "no item" :
          uniteprice = o;
public double getunitprice() {
     return uniteprice;
public String getname() {
     return name;
public void setName(String newName){
          this.name = newName;
public void setuniteprice(double newuniteprice){
          this.uniteprice = newuniteprice;
public String toString(){
     return "\nitem name:" + name + "@" + "\nuniteprice:" + uniteprice;
public class WeighedItem extends PurchaseItem {
     private double kg;
     public WeighedItem(String name , double unitprice , double kg) {
     super (name , uniteprice);
     this.kg = kg;
     public double getunitprice() {
          return uniteprice + "" + kg;
public String toString() {
     return "\nitem name:" + name + "@" +"\item weight:" + kg + "\nuniteprice:" + uniteprice;
public class counteditem extends PurchaseItem {
     private int quantity;
     public counteditem(String name , double unitprice , int quantity) {
     super (name , uniteprice);
     this.quantity = quantity;
     public double getunitprice() {
          return uniteprice + "" + quantity;
public String toString() {
     return "\nitem name:" + name + "@" +"\quantity:" + quantity + "\nuniteprice:" + uniteprice;
i know i still miss the test class but that not important now i just wish someone will help me with the corrections of the above code PLZ
thanx in advance :(

When you post code, wrap it in [code] tags so we can read it.
Also indent it sanely.
If you can't compile, post the compiler error messages.
If it runs but throws an exception, post the stack trace.
If if runs without throwing an exception but you've foolishly written your code to silently catch exceptions, fix your code by actually printing the stack trace in the catch blocks, then rerun.
If your code smartly reports exceptions, and it runs, but it still doesn't work, try adding some debugging code (displaying the values of various variables and showing when methods begin and end, for example) to help narrow down the problem. When you've narrowed down the problem, try writing a small, compilable program that exhibits the same problem. If you can't fix it with that, post the example program here.

Similar Messages

  • Need some quick help - fairly urgent!

    I've just taken over a new job and have been the task of finishing the new brochure for Christmas, there's not a lot to do but a lot of the measurements need changing
    This is the layout I'm dealing with..
    All the boxes have been made in Illustrator
    The text has been done in In'Design and it seems every piece of text is it's own box if that makes sense
    My question is, if I select the whole specification box - copy, paste it into Adobe Illustrator and change the text there, then paste the edited box back into In-Design, will I lose quality when it gets printed?
    I'm worried if I do it this way it may come out blurred? Or am I just worrying about nothing?

    I couldn't find an Illy file in the end and have ended up creating tables in ID to replicate what was already there!
    Didn't take very long and I guess if I didn't do it now, I'd come across the same situation next time!
    Date: Wed, 30 Nov 2011 08:48:07 -0700
    From: [email protected]
    To: [email protected]
    Subject: Need some quick help - fairly urgent!
        Re: Need some quick help - fairly urgent!
        created by Peter Spier in InDesign - View the full discussion
    There certainly are viable "quick fix" solutions proposed here, and if the dealine is looming and this file never needs to be touched again I might be tempted, but they are only postponing the pain for a file that needs periodic updates, and I wouldn't waste effort on them, myself, when that time can be put toward a proper rebuild now if that's the ultimate goal.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4054725#4054725
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4054725#4054725. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in InDesign by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Need a quick help on Pro*C

    Hi All,
    I need a quick help on Pro*C. Here's the details on the same:
    - My program takes one input file as parameter. Lets assume argv[2] is the name of the inputfile, which is my input parameter as well.
    - ps_filename = argv[2]; I'm copying argv[2] i.e. filename in a variable called ps_filename
    - Now this inputfile can be of two types, say type A_yyyymmddhhmmss.dat and B_yyyymmddhhmmss.dat.
    - Therefore for every run I'll have one of this value as input parameter which will be copied into the ps_filename.
    - Now I need to call two different functions based on the inputfile i.e. if ps_filename like 'A%' then call func A() else call func B();
    But in ProC/C there is no provision to use like operator.
    Therefore my question is how can I have ps_filename like 'A%' in C?
    Can anyone please help me to solve this issue?
    Hope to get your co-operation.
    Thanks & Regards,
    Debabrata

    debabratas wrote:
    Therefore my question is how can I have ps_filename like 'A%' in C?Hello, why don't you just substring on the first character, and if that's an 'A', then LIKE 'A%' will also hold.
    For example, in Pro*C:
    if (substr(ps_filename,1,1) == 'A') {
    ..

  • Need Some Quick Help w/Digital Frame for Xmas Gift Please...

    Have a Kodak digital picture frame. I don't understand the architecture of using the SD or USB cards w/the frame. I bought a 1 and 2-gb SD card. When copying my photos to the cards (112 of them), I get about 92 on the 1-gb card and it says full, but still shows most of the disk available, but also says is full so only about 92 photos goes on there. So I try the 2-gb SD card, and exactly the same amount of photos fit??? Why - it is twice as big??? I tried reformatting it to Macintosh but that only made the frame not recognize it, and when I formatted it back to MS-DOS, the frame still does not recognize it...Question one...Why the 1 and 2 gb SD cards hold only the same amount of pictures and how can I get it formatted back to be read by the camera...and can I fill 112 pictures on??? So then I thought maybe a USB stick would work. Bought a 2-gb Lenar Firefly stick and whoa and behold the exact same thing happens...I get about 92 pictures. So I figured which 92 pictures I wanted and selected all the card contents, moved to trash and deleted the pictures, then went back and picked only the 92 pictures I wanted and copied to stick and all show that they are there, but when I go to play them on the frame the old pictures I had on there before are there and not just the 92 new ones. How do I get rid of everything on the disk and get the pictures onto it that I want...I am afraid to erase or format it in any way because the frame probably won't recognize it again. Also, there is one picture that says "Bad file" and I have no idea which picture this is...and can't get rid of it because when I move them all to trash and put the new pictures on the stick that one is still there????? On the stick, I have like 130 MB (112 Pictures). When copied it says 92 pictures with 1.76 GB available...why is this and why can't I copy pictures to that space??? Can someone explain this to me and advise me what I can do, how do I reformat it so recognized also??? Also, I have songs copied to the frame's internal memory, but can't figure out how to play the pictures and also music at the same time????? Thanks so much for any quick help and thorough explanation so I can get this wrapped and sent. Merry Christmas! Gary

    I also have a Kodak picture frame and had the same problem with my SD card. Two things I learned.
    1-Even though you can't see them on the card - there are hidden files. You can see them - use this procedure.
    http://www.tech-recipes.com/rx/3104/os-x-show-hidden-files-and-folders-in-mac-os -x-finder/
    2-The other item I learned is that you must drag and drop the files and then empty your trash. While the reader is connected to the machine.
    Doing these two items will clear your card to full capacity.
    As far as the "bad file" I am still working on that one. I have little movie clips on my card and believe that may be causing this view..so your music may be causing this message. Start with just the pictures only and see if you can load them onto the frame.

  • MOVED: not seeing SATA HD, quick help plz

    This topic has been moved to AMD64 nVidia Based board.
    not seeing SATA HD, quick help plz

    Quote from: Cavalyr on 09-April-05, 17:49:44
    last thing i did before this problem started was install nTune and was running one of the things it has
    What is ntune?

  • N73 - quick help plz

    i have a serious problem. i tryed to change housing on my n73 me,and all of the sudden my keypad stops working properly (menu,`c`,`0`,pads wont work!).i have another n73 and i treyd to swap keypads,and that one works on other one.so,both of them work fine.I came to the conclusion that software is making problem. i wanted to format n73 me,but i was disabled to do that.as i was saying,`0` pad doesnt work,so i cant type *#7370#. i tryed `*`,`3`,green key,but it just restarted.my last option is to use pc suit.i updated software version,just now as i wrote,and nothing. it wont work againa! i know that hard reset will do the trick,but i dont know how to preform it! some one plz help!

    @psychoactive
    There is no message as no lock code needs to be inputted and fact that you get choose region screen is message of success. Are you saying that all data has not been erased as device should be in "Out of box" state now?
    Happy to have helped forum with a Support Ratio = 42.5

  • I'm new to java and I need some quick help with NetBeans.

    Hi. To whomever can help here's the problem. I've been trying to install netbeans ide 5.0 on my computer for a while now and i can't seem to find out what is wrong. I'm in a java programming course and i need the J2SE Developement Kit 5.0 Update 7 and NetBeans IDE 5.0 Installer on my comp. Whenever i go to install it, it can't automatically create a directory and has erroe null in place of it. Whenever i made a new directory for it a page would come up telling me all of the errors during the installation which are null. Since i have administrator privelages and plenty of free space on my hardrive.

    Hi,
    I want to suggest you that
    1.please check if any prerequisite is require before installing the NetBeans IDE,i hope there is nothing like that except proper jdk on your machine.
    2.if you already having JDK on your machine check for the compatibility of that jdk version with the required NetBeans IDE version.
    3.follow the steps provided to install the NetBeans IDE 5.0 for that refer the below link
    http://www.netbeans.org/community/releases/50/install.html
    hope you will get rid of the problem .....
    ---Vidya

  • Need some quick help with redoing a website

    Hi, I did my website done in iWeb in 2008, published it, and have it hosted by GoDaddy. I want to take it offline for now and design a new 'under construction' site, but there is a chance that I might want to still go back to the original version.
    I see the current 'Domain' in Home Folder>Library>Application Support>iWeb.
    Can I just redo my site (still working in pre-2008 iWeb), publish it, and if I need to, use the old 'Domain' to revert to my current website?
    If yes, how do I do that....and, if 'no', what should I do?
    Thanks!

    Hi and thanks. To reply....
    I published the website in iWeb and it is on my MobleMe. It was done in iWeb v 1.1.2, and I have not upgraded iLife on the computer that I designed the website on, as I feared losing some/all of it in an upgrade.
    I do, however, pay GoDaddy for my corporate URL AND hosting....which I suspect is the forwarding and not 'hosting' per se....but on my Hosting account on GoDaddy it does say 'Shared Hosting'.
    I do not want to 'overwrite' my current site just yet, as I am uncertain about the next one's content or the time to do it the way I envision it. What I want to do is SAVE my current site in case I want it back and, in the meantime, put up a page that says Under Construction. Can you help with that?
    Much appreciated

  • HELP IM 13 YEARS PLD AND I NEED ANYNOE TO HELP PLZ READ THIS POST

    I lost all my music from my library and i cant find it anywhere is there a way i can take the songs on my ipod and put thm in my library. plz help!

    Li Kid,
    I found the following steps to recover a deleted library. Not sure who the author is but it worked for me.
    Start with the iPod disconnected from the computer - DON'T CONNECT IPOD YET
    - open iTunes
    - open iTunes Preferences - this blocks iTunes from seeing an iPod connection; leave the preferences window up and running
    - connect the iPod to the computer, wait about 15 seconds before continuing
    - open 'My Computer'
    - Tools menu, Folder Options, View tab, enable 'show hidden files /folders'
    - open iPod icon in My Computer
    - open iPod_Control folder
    - you should see a folder named Music
    - drag this folder to somewhere on your computer hard drive
    - after the copy completes, right-click the new Music folder on your hard drive and select 'Properties'
    - clear the checkmark next to 'Hidden'
    - Close that explorer window
    - eject iPod from System tray "Safely Remove Hardware" icon. This icon looks like a small gray rectangle with a green arrow floating above it. It's only there when a removable device (like the iPod in this case) is attached to the computer. Right-click & select 'Safely remove..', then click 'Stop' in the next window, OK in the next window, and then Close to complete the ejection.
    - disconnect the iPod from the computer
    - go back to iTunes, cancel the preferences window
    - File menu \ Add folder to Library \ find that Music folder copied over from the iPod
    Your iTunes library should be back in action! But wait - there's more!!

  • New to the game and need some quick help

    I have been thrown our exisiting phone infrastructure and what do you know we are having some issues.
    We have a new series of DID's and when they are dialed from our directory they go anywhere? Not routing to the proper extension.  Translation pattern looks good in comparison to the extensions that are working.
    Cisco Unified CM Administration System version: 6.1.3.3000-1
    Cisco Application Administration - 5.0(2)_Build064
    Package: Unified CCX Enhanced
    Regards,
    Dan

    First thing to know is that everything that has a DN can be used for routing, so it's a good idea to look at the route plan report to find matches.
    If you can't find an exact match, chances are you're hitting something with wildcards ie X, [1-2], etc
    An easy way to check routing if you're new to the game is to use DNA
    Cisco Unified Communications Manager Dialed Number  Analyzer Guide, Release 6.1(1)
    http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/dna/6_1_1/bw-dna.html
    HTH
    java
    If this helps, please rate
    www.cisco.com/go/pdihelpdesk

  • "itunes encountered a problem and needed to close" - help plz

    I've been using itunes for a while but when my sister got a new ipod she wanted the upgraded program so i downloaded the new program on top. It worked until we rebooted the computer and since then it would come up with an error. Afterwards, I uninstalled the program and reinstalled itunes 7.0, but when we went to open the program it said it couldn't read the itunes library, so i then deleted those files and now instead it says "itunes encountered a problem and needed to close" whenever i try to open it. Can someone please tell me what to do?

    wanpedro I tried what you suggested but have again got nowhere.I tried to uninstall QuickTime it just wont.I uninstalled iTunes & reinstalled it with QuickTime from Apple website.I'm back to where I was with the error message
    "iTunes & Quicktime have encountered a problem & need to close tell Microsoft about this problem" When one does that there is no feedback from MS With Qucktime uninstall a message says Fatal error on installation.

  • SQL Commands.Need a quick help.

    Hi Guyz,
    I need to know if the table spaces are auto extend or not.which command should i use.
    Thnx in advance
    Navneet Kaur

    Auto extent is turned on/off at datafile level, check
    select FILE_NAME,TABLESPACE_NAME,AUTOEXTENSIBLE from DBA_DATA_FILES;

  • Need a quick help!! Query hangs for hours

    Hi Guys,
    This is actually a stupid rollback query iam working on, for a one time load which is to be done this weekend.
    DELETE FROM OWNER.SBS_PYMT_FEE where CRE_USR_ID='';
    The actual problem, it takes hours to respond in QA and should take more time in PROD Considering the volume, it is doing a full table scan and our DBAs suggested Indexing on CRE_USR_ID would be a bad idea as the table is partitioned and is huge. CRE_USR_ID is the only column identified for 1 file.
    This is a one time activity.
    Any ideas or work arounds would help me a lot.
    And sadly, I do not have access to more stats.
    Thanks,
    Raj.

    I wondered about parallel settings because parallel_dml_mode is disabled by default:
    SELECT name, value, isdefault
    FROM   v$ses_optimizer_env
    WHERE  sid IN
           (  SELECT sid FROM v$mystat )
    AND    name LIKE 'parallel%'
    ORDER BY name;
    NAME                           VALUE                     ISD
    parallel_ddl_mode              enabled                   YES
    parallel_degree                0                         YES
    parallel_dml_mode              disabled                  YES
    parallel_execution_enabled     true                      YES
    parallel_query_default_dop     0                         YES
    parallel_query_mode            enabled                   YES
    parallel_threads_per_cpu       2                         YES
    7 rows selected.(example from 11g)
    Message was edited by:
    William Robertson

  • Need som quick help

    I'm looking to subscribe to Verizon Fiber Optics but their specs for internet service is as follows:
    20 Mbps/5 Mbps FiOS Speed Package
    System Requirements:
    OS Supported: Yes
    CPU Speed Minimum: 233 MHz
    CPU Speed Recommended: 733 MHz
    Front Side Bus: Not Supported
    Minimun RAM Memory:128 MB
    Recommended RAM Memory:256 MB
    External Media: CD-ROM
    Free Disk Space: 100 MB minimum
    Free Disk Space: 200 MB maximum
    Wired Ethernet I/F: 10/100 NIC
    I come within most requirements except I don't know what they mean by Front Side Bus? I do have a Asante Talk 10T-Local Talk which I use to use with an old serial printer. My alternative is to buy a new computer, please advise.
    Thanks

    With very few exceptions, ISPs don't need* to install any software at all on your computer; the necessary interface they supply is the cable/FiOS modem, which must communicate with their equipment on the WAN side, using whatever protocol they want, and with your computer on the LAN side, using standard industry protocols that are supported by every modern operating system. The only specification in this list that is really important is "Wired Ethernet I/F: 10/100 NIC", which is the physical LAN-side connection from their modem to your network (computer or router, whatever you have); and that's very common -- it should plug right into your G3.
    * Most ISPs that do ask you to install software on your computer are asking you to install "branding" or "enhanced experience" (read: branding) software. Some also offer pop-up-blocker/anti-virus software which isn't really necessary at this time for a Mac. When they list "system requirements" for processor speed, memory, disk, cache, etc., they're listing the requirements for this unnecessary software.
    Powerbook G4 1GHz   Mac OS X (10.3.9)  

  • Not seeing SATA HD, quick help plz

    hello all. thnx in advance for help. desperate here. was having an issue. formatted. was doing alright. installed XP Pro. rebooted. installed a few things. rebooted a few times. this last time i rebooted, the bios does not see my WD Raptor 36GB HD. does not see it on SATA 1 thru 4. but will see it on SATA 5 and 6. tries to boot, but restarts and then tries again. last thing i did before this problem started was install nTune and was running one of the things it has. it stalled. hot booted and now here i am. i have everything else unplugged but the A drive, raptor hd and the dvdrw. i just flased the bios and still nothing. here are my components:
    K8N Neo4 Platinum SLi
    MSI GEForce 6600GT 128 SLi vid card
    1 X WD Raptor 36GB HD
    3 X 200GB WD 8MB
    1 x LiteOn DVDRW
    thnx all.

    Quote from: Cavalyr on 09-April-05, 17:49:44
    last thing i did before this problem started was install nTune and was running one of the things it has
    What is ntune?

Maybe you are looking for

  • Problem printing PDF with Acrobat Pro 9.4.4

    Hi! I can't correctly print a PDF with Acrobat Pro that was created in Indesign CS5. I want to print it on a letter format (8,5 X 11") and it offers me a format of 8,49 X 10,99". It results in having my document being printed as tile with it's origin

  • Adding action in Dropdown fields in visual composer iview

    Hi, I develop a application in Visual composer 7.0. I want to convert the input field in drop down for selecting the different values. I can change the same by selecting the particular input fields in design screen. But I not able to specify the valu

  • Preloader works in Flash, but not after upload

    Hi all. I'm having problems with a preloader. When I test the preloader in Flash (using the simulate download option) it works like a charm. I publish and upload the file to the server...and when you visit the site, you just get a blank white page un

  • Fake Apple Inc. pages on Facebook

    I would like to report some Facebook business pages that are posing as pages maintained by Apple Inc. These pages are not owned, maintained or operated by Apple Inc.; the original VERIFIED Apple Inc. business page was deleted awhile ago. In fact, one

  • How can I trim the main audio clip for slideshow

    I have created a slideshow with photos and video.  I want to add music, but would like to trim the main audio.   If aperture doesn't have this feature, can I export my slide show to iMovie.  What can I do?