Getting missing method error - first attempt at arrays

I'm trying to work with arrays for the first time ever - I understand the concept, but can't quite get the syntax down. Here is the class which won't compile and is giving me a missing method body or declare abstract message - please help me understand what I'm doing wrong.
import java.util.Scanner;
import static java.lang.System.out;
public class Inventory
  //declare and initialize variables
   private int itemNumber = 0;
   private String productName;
   private int stockAmount = 0;
   private double productCost = 0;
   private double totalValue = 0;
   private double totalInventory = 0;
   //initialize scanner
   Scanner input = new Scanner(System.in);
   public Inventory (int itemNumber, String productName, int stockAmount,
           double productCost, double totalValue);
   out.println("Please enter item number: "); //prompt for item number
      itemNumber = input.nextInt();
   out.println( "Enter product name/description: "); //prompt for product name
      productName = input.next();
   out.println("Quantity in stock: ");
      stockAmount = input.nextInt(); // prompt for stock quantity
   out.println("What is the product cost for each unit? ");
      productCost = input.nextDouble(); // prompt for product cost
        totalValue = stockAmount * productCost; //calculate stock value
      } // end calculate stock value
      { //request for inventory details
        out.printf("%s, which is item number %d, has %d pieces currently in " +
            "stock at a price of %.2f each. The total value of " +
            "inventory in stock is %.2f\n.", productName, itemNumber, +
            stockAmount, productCost, totalValue);
      } // end request
  }// end classHere is my main method - I don't think I'm referencing things the way I'm supposed to.
public class Main {
  public static void main(String[] args) { //start main method
        Inventory inventory = new Inventory(); //call Inventory class
        inventory.inventoryInput();
}

LOL - you are right, I don't really know what I'm doing. I don't understand this and am just trying to muddle my way through this whole thing...as you can tell I'm facing many challenges.
Here is how I've changed my main method and the Inventory class - still getting error messages though - any additional hints/suggestions?
Inventory class
import java.util.Scanner;
import static java.lang.System.out;
public class Inventory
  //declare and initialize variables
   private int itemNumber = 0;
   private String productName;
   private int stockAmount = 0;
   private double productCost = 0;
   private double totalValue = 0;
   private double totalInventory = 0;
   //initialize scanner
   Scanner input = new Scanner(System.in);
   public Inventory (int itemNumber, String productName, int stockAmount,
           double productCost, double totalValue)
   out.println("Please enter item number: "); //prompt for item number
      itemNumber = input.nextInt();
   out.println( "Enter product name/description: "); //prompt for product name
      productName = input.next();
   out.println("Quantity in stock: ");
      stockAmount = input.nextInt(); // prompt for stock quantity
   out.println("What is the product cost for each unit? ");
      productCost = input.nextDouble(); // prompt for product cost
        totalValue = stockAmount * productCost; //calculate stock value
      } // end calculate stock value
      { //request for inventory details
        out.printf("%s, which is item number %d, has %d pieces currently in " +
            "stock at a price of %.2f each. The total value of " +
            "inventory in stock is %.2f\n.", productName, itemNumber, +
            stockAmount, productCost, totalValue);
      } // end request
  }// end classMain method
public class TestInventory
    public static void main(String[] args)
    {Inventory[] inventoryArray = new Inventory[3];
     inventoryArray[0] = new Inventory(0, 2541, Radios, 14, 15.95);
     inventoryArray[1] = new Inventory(1, 1685, VCR, 10, 98.95);
     inventoryArray[2] = new Inventory(2, 5872, Clock, 8, 12.95);
     For (Inventory inventory : inventoryArray)
         System.out.println(Inventory);
}

Similar Messages

  • TS3212 I tried to update my iTunes, but I keep getting a runtime error  R6034 Attempt to run C runtime library incorrectly.    I also got an Error 7 (Windows error 1114)

    I tried to update my iTunes, but I keep getting a runtime error R6034 attempt to run C runtime library incorrectly.  I also got an Error 7 (Windows error 1114).  Now my currently iTunes will not open.

    Hey twhitten!
    Here is an article that will help you troubleshoot this issue:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Take care, and thanks for visiting the Apple Support Communities.
    Cheers,
    Braden

  • I get a runtime error when attempting to search the store in Itunes.  I unistalled and reloaded. How can I fix this?

    I just began getting a runtime error when attempting to search the iTunes store.
    I uninstalled and reinstalled but, it's still happening.
    How can I fix this so I can start to buy music again?

    I have the same error, but I think we will get no solution for this problem.
    You've get no answer here and the Apple support also doesn't send an answer how to solve the problem.
    BTW I have also Windows 7 and the newest version of iTunes 64-bit.
    Greetings Mike

  • TS3258 iphone get missing componet error 42404

    iphone keeps   getting missing component error 42404 can some one please help with problem?

    Hello cstev,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iTunes: "Error 42408" or "Error 42404" after upgrading to iTunes 9.0.3
    http://support.apple.com/kb/TS3258
    If you're using an old version of windows please:
    Update to the latest version of iTunes.
    You can download the latest version of iTunes here.
    Best of luck,
    Mario

  • Why do I continuously get the following error when attempting to access the Apple Support Communities Tutorials:

    I would like to review the support community tutorials, but cannot?  Continue to get the following error: 
    Not Found
    The requested URL /___sbsstatic___/apple/tutorial/index.html was not found on this server.

    Is this the page you are talking about?
    https://discussions.apple.com/static/apple/tutorial/index.html

  • For all of you, who gets "missing file" error on syncing theirs photos

    I dont really knows any better way of correcting this error when deleting "iPod photo cache" -file doesn't help, but here is my answer to that. If somebody knows a better solution, plase tell it to all of us.
    I was getting an "unknown errorcode -39" and that "missing file" messages every time i try to sync my photos from my Windows 7 based computer to the iPad. It seems to me that there are something wrong on the iPed side but how to corrrect it (and i dont know anything on how apple works)?
    Just as i was gioing to give up, i realize that there must be two caches in sync, one for sender (for itunes) and one for a receiver (for example iPade) side. Both must be in sync whith themselfs and in a filesystem on their side. Easy part is on iTunes side, just delete the cache (thats because its contents can and will be recreated using the local filesystem information only).
    The other side (iPhone or iPad) is much more harder to do as there are not (or i dont have found it) any simple solution to do it. There are only one solution which i have found to be solve this problem (every time) and it is that you have to get a sync target to think that it is being sync on a different iTunes photo library (even when its empty). If this works, then you get a iTunes message saying that "are you sure?, as if you continue ALL FILES ARE DELETED when your are resynced on different photolibrary". That is just what we wanted. For myself it has worked every time, but it takes time, as you must resync it twice (once in an alien or differentt, and back to the original or updated photolibrary).
    Those who knows better, comments please?

    Part 2.
    Another thing that all Encore users ought to regularly offer up a daily prayer of thanks for is the PSD support for menus.
    Let me tell you a little story, all about how bloody awkward it
    i can
    be, again using Industry Standard "Flagship" applications.
    The little saga above about the additional _HL_LB image completely forgot to mention that there is a very nasty scaling issue awaiting the ignorant (like me).
    It doesn't scale the letterbox image automatically.
    SO, it's a case of as usual, preparing all Widescreen assets in anamorphic mode (create & design in PS using PAR correction, reshape image to Square Pixels)
    Duplicate the _HL for the _HL_LB image.
    Now, because of the rescaling issue, take this into PS, and resize the image to 720x360, then resize the
    i canvas
    to 720x480, making certain your background is white, as failure to do this will mean the Letterboxed SPHL are incorrectly scaled, although the button hotspots are in the right place.
    Aargh - if it was not for the "Phone A Friend" option, I would still be stuck on this.

  • They get 'Missing Links' error messages ... Why?

    I created a piece of Artwork (probably best done in Indesign, but Illy is my preferred), and sent it to the publisher.
    I placed images in the document.  I 'Saved As' and choose PDF, and made sure I had the Embedded images option ticked.
    They are using CS4 and I'm using CS so its not that I'm going backwards (then I'd use export).
    So, my question is, why are they getting this error message (I realise it is because they are missing the links, and don't have the images)?  Other than sending them all the images/logos is there another solution?
    My specs: Windows XP Pro, Illy CS.
    Thanks

    Thanks tman69 & Wade,
    I've managed to speak to the printing company and sorted it all out.  It was a combination of her trying to view the letter outlines on the raster images as the file has both raster images and vector images in it.  So, she could see the outline of the vector ones but not the others.
    Wade, now that I've read your post I think I mis understood you.  I had created another version when saving it.  I have no issues with disk size so didn't even take that into account (I should read more closely).  I have sent them both the original file, and the new saved as file.
    Fortunately this is now fixed.
    Thanks

  • Missing points + error when attempting to report them with form

    Heya, I made a substantial purchase (multiple appliances) on the website on June 15 and the points aren't showing up in any way (pending or other). When I try to fill in the form for missing points, I get this message "The information entered doesn't match our records. If the purchase was made in the past few hours, please try again later.". And, obviously, the purchase was made many weeks ago, so that's not the problem.  Where do I go from here?  Thanks.

    Good afternoon jblob, and welcome to the Best Buy forum,
    After looking over your information using the email address you registered with the forum, I can confirm that the purchase in-question is attached to your My Best Buy account.  That is why you have been encountering errors while trying to report it as "missing" on BestBuy.com.  You will not see points emerge as pending until after the items you purchased have been shipped or delivered, and once those points are pending, they should officially post within 20 days.
    If points have not officially posted to your My Best Buy account 20 days after the final delivery or if you have any additional program related questions, then please do not hesitate to send me a private message and I will see what I can do to help.  You can send a private message by clicking on the blue button in my signature that is labeled "Private Message."
    Thank you for posting and for being a My Best Buy member.

  • Excel-ActiveX-Maximized if I close it, I get missing reference error

    I have report which is generated  using excel(not Report genration Toolkit).... There is an option for window state.
    Well I want it open,(but the problem is if someone closes the excel file, I get errors saying no reference... and all that thing)
    Is there a way to view this way(i.e. updates while entering and does not cause problems if we close it)
    Solved!
    Go to Solution.

    Hi karthik,
    you need to program some error handling.
    When your user is able to close the excel workbook while your program is working with it, you need to check for errors. When an error like "missing reference" is popping up you need to re-open the workbook…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Getting an internal error when attempting to delete a certificate

    When attempting to delete a certificate on one of our servers using the Windows Azure Managment Portal we receive an error "The server encountered an internal error. Please retry the request. The long running operation tracking ID was: 33c70589cc21ba74903d8e7bffe7868b."
    We have been able to delete this certificate on other servers and have been able to delete other certificates on this server. Is there anything we can do to get rid of this certificate?

    hi,
    >>We have been able to delete this certificate on other servers and have been able to delete other certificates on this server
    What service certificate you attempted to delete? Cloud service or VM ? Did your delete the certificate by connecting RDP to VM  before delete certificate on Azure portal? I need confirm those information.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Hi Will,
    Thanks for looking at this, to answer your question it's a Cloud Service certificate, and we only attempted to delete the certificate in the portal. Is there any other info we
    can give you?
    Thanks,
    Mike

  • Delete item to wastebasket get missing user error

    When I tried to delete a document from "my portfolio" in portal to my waste basket, I got error message "missing user". By checking the SAP log trace file, it showed "Cannot instantiate user <anonymous>".
    Our Portal (Netweaver 7.0) is SSO to LDAP, and BI backend system. I was logged in to the portal as admin when tried to delete the document. Don't understand the above message why it was trying to instantiate anonymous user?
    Any helps will be appreciated.

    Hello!
    Which SP Version are you using? Because we had similar problems which were solved with SP 17.
    BR, Christian

  • Trying to package InDesign file, gets missing plugin error

    I've been trying to package this magazine and it keeps telling me i'm missing this external plugging called 'asset management.InDesignPlugin'. when i try googling it i can't find anything.

    If Peter's solution does not help, here's another way, because the missing plugin might just be incorrectly registered or not at all:
    1. Find the location of your Indesign preferences file, copy it to a safe place, delete the original.
    2. Start Indesign - it will re-register all plugins. Close Indesign again.
    3. Write back the saved prefs file to the original location.

  • Why am I getting missing plugin error in CS4 Indesign when trying to open indd or PDF files?

    Any help would be appreciated?

    PDF files cannot be opened in InDesign.
    InDesign files which are not able to be opened might come from a newer version, you might ask for an IDML file, but better to upgrade to the same version.

  • I am getting the following error: Unable to authenticate the package: B_SPACE_NUTRITION.itmsp                     ERROR ITMS-9000: "OPS/ibooks.ncx(5): element "content" not allowed yet; missing required element "navLabel"" at Book (MZItmspBookPackage)

    I am getting the following error when attempting to deliver my iBooks Author book package via iTunes Producer: "
    Unable to authenticate the package: B_SPACE_NUTRITION.itmsp
                        ERROR ITMS-9000: "OPS/ibooks.ncx(5): element "content" not allowed yet; missing required element "navLabel"" at Book (MZItmspBookPackage)"
    I understand that there's something wrong with the TOC file (.ncx), but I have tried everything and nothing seems to work. Every section of the TOC is labeled, so not sure why the navLabel issue is happenening.
    Any help is GREATLY appreciated! Thank you.

    Similar issues looks like. Are you using a template other than those in iBooks Author? That's what I did, and that was definitely part of the issue.
    After digging through .ibooks code for hours and still not seeing the problem, I decided to reach out to one of the Apple epub conversion affiliates in iTunes Connect. They said they could repair the file without a problem, started working on it, only to come back a week later and say they couldn't work on .ibooks or .iba files yet.
    So, in complete frustration, I decided to transfer my content page by page from the blank template I downloaded from a vendor online to one of the "textbook" templates in IBA. This was a long process as I had to unlock and clear out the formatting of the template. But, once that was done and content was transferred over, all was good. I submitted/delivered the same content and preview book within the new template and it went right through the first time (all metadata was exactly the same as well).
    Now, the iBookstore approval waiting process begins!
    Good luck!

  • Get 'Generic Error' when attempting to import .mov files with transparency?

    I get the 'Generic Error' when attempting to import .mov files with transparency? I'm trying to use mattes with an alpha channel but I cannot import them. I have had this same issue since cs6, now I have it with cc 2014? Any clues would be most appreciated.
    I have uninstalled the DVCPro Codec, but it didn't help.
    I have tried converting the .mov file (which is now automatic in Yosemite) and this creates a ProRes4444 Codec, Again no luck with import.
    I've seen this issue on the web, but never a solution? Anyone?

    Hi Terence,
    I tried iPhoto Library Manager but it could not solve my problem. Opening the iPhoto library I can see that the reference to the pictures are pointing to my old location not to the new one. I considered running a script that would change all pointers since this is basically what is needed (in my case from /Volumes/RAID1/Fotos/XXX to /Volumes/Fotos/XXX). Instead I inserted a soft unix link to make to connection but that did not work. It is referring to the airport disk by the airport name rather than the mounted disk name. Very strange indeed. The problem is maybe not in iPhoto but in OSX? Anyway, maybe the only way out is to take some hours and manually run through all linked photos... cumbersome and annoying!
    Regards,
    Søren

Maybe you are looking for