Please help... this is kind of urgent!

Hello,
I have to create a product class that holds the item number, product name, units in stock, and the unit price.
I also have to create a java application that displays the same info.
I have been working on this for three days now... I am getting frustrated because it is due tonight and it doesn't seem to work.
A little help will be very much appreciated..
Below is my code... I was able to compile it but when I run the application, it gave me this error:
Exception in thread "main" java.lang.NoSuchMethodError: main
// InventoryProgramPart1.java
// A program that holds a music CD inventory.
// Author:MMM
// Date Created: 02/13/2009
import java.util.Arrays;
     public class InventoryProgramPart1
          String musicCd[] = { "Fergie", "Celine Dion","Kelly Clarkson", "Chris Daughtry"};
          double itemNum;
          double count[] = {5, 7, 3, 8};
          double totalValue [] = new double [4];
          double price[] = { 19.95, 21.99, 16.50, 21.75};
          double totalInvVal;
          // Method for printing dvdName the dvdName
          public void musicCd ()
               // For loop to calculate total value
               Arrays.sort(musicCd);
               for( int itemNum = 0; itemNum < musicCd.length; itemNum ++ )
               totalValue[itemNum] = count[itemNum] * price[itemNum];
               System.out.printf( "%s %15s %12s %12s %12s\n", "Item Number", "CD Title", "Price", "Stock", "Total");
               for ( int itemNum = 0; itemNum <musicCd.length; itemNum ++ )
               System.out.printf("%-8d %20s %10.02f %12.02f %12.02f\n",
                    itemNum, musicCd[itemNum], price [itemNum],count[itemNum], totalValue[itemNum]);
               } // end of method to print dvdName
               // Method for total value of the inventory
               public void totalInvValue()
               { //start of method to calculate the total inventory value
               totalInvVal = count [0] * price [0] + count [1] * price [1] + count [2] * price [2] + count [3] * price [3];
               System.out.printf("%s", "The Total Value of the Inventory is:","%10.02f");
               System.out.printf("$%.02f", totalInvVal);
          } // end of method
     } // end public class InventoryProgramPart1

We don't care how urgent it is... except that it prompts me to remind you that you should have started earlier. Putz!
Now, what seems to be the problem?
Exception in thread "main" java.lang.NoSuchMethodError: mainHmmm... Now what could that mean? ... Hmmm...
Long answer: Well, to me it means you've never actually compiled and run a java program before. Correct? Which means you haven't been paying attention in class, haven't been doing your labs, and this is the first time you've deigned to actually crack open the compiler. If you had actually bothered to undertake any of the above due-dillegence obligations you would know by now that in order to execute a java program by the usual method one (or more) classes must define a method with the signature public static void main(String[])
Short answer: You forgot the main method. Putz!
Shortest answer: Get a hair cut!
;-) Cheers. Keith.
Edited by: corlettk on 14/02/2009 14:51 ~~ Typos. Ooops!

Similar Messages

  • My iPhone hasn't turned on in 2 days and none of the solutions i have looked up worked, please help,this is a very urgent matter!

    my iPhone hasn't turned on in two days and none of the solutions i have looked up worked. i need all the help i can get. this matter is very urgent!

    Before we can help you we will need more information. Did you try to reset the phone while it was charging by holding the power button and home button until you saw the apple then let go? Please give a summary of what you have attempted, any error messages, what do you see on the screen, if anything.

  • Quicktime recording question PLEASE HELP - It's kind of urgent

    for over a yaer now, i have been using quicktime to record songs from the internet. for example, if there was a song i liked by a band on myspace but you couldn't download it, id record it. what i'd do is take a male to male 3.5 mm cable and id plug it into both the input and the output slots in the back of my mac, and then i could record just the sound, without any outside noise such as cars passing by. the quality was always really good.
    BUT - just recently, my recordings have been having reallllly bad echo-y sounds, and the quality is just atrocious.
    is this a problem with my cable or what? how can i fix it?
    thank you so much in advance for an answer

    We don't care how urgent it is... except that it prompts me to remind you that you should have started earlier. Putz!
    Now, what seems to be the problem?
    Exception in thread "main" java.lang.NoSuchMethodError: mainHmmm... Now what could that mean? ... Hmmm...
    Long answer: Well, to me it means you've never actually compiled and run a java program before. Correct? Which means you haven't been paying attention in class, haven't been doing your labs, and this is the first time you've deigned to actually crack open the compiler. If you had actually bothered to undertake any of the above due-dillegence obligations you would know by now that in order to execute a java program by the usual method one (or more) classes must define a method with the signature public static void main(String[])
    Short answer: You forgot the main method. Putz!
    Shortest answer: Get a hair cut!
    ;-) Cheers. Keith.
    Edited by: corlettk on 14/02/2009 14:51 ~~ Typos. Ooops!

  • Please help me, HSC major project, urgent

    Hi,
    I am doing an interactive storybook for a HSC project. I am trying to code for it and it is telling me two error messages. These are 1120: Access of undefined property. I tried to insert a screenshot but it wont let me in this question. Maybe I message individual people the screenshot ?
    How do I fix this error message ?
    here is my code:
    stop();
    Page1_btn.addEventListener(MouseEvent.CLICK,turnpage2);
    function turnpage1 (evt:MouseEvent):void {
      screen_mov.gotoAndPlay ("Page2");
      page1_btn.visible = false;
    So the pages are numbered starting at 1, 2,3 3, 4, 5, ..............................
    Screen_mov is the movie clip for the project containing all the pages/ graphics
    and page1_btn is the button for page 1
    PLEASE HELP THIS IS URGENT !

    Hi,
    I am having further troubles. In my storybook on the first page all the buttons are appearing, I do not want this. How do I code to fix that, the only button I want on the first page is "page1_btn"
    will paste my coding into here, and could you please tell me what to do to fix this ?
    page2_btn.visible= false;
    p3_first_btn.visible= false;
    page1_btn.addEventListener(MouseEvent.CLICK,turnpage2);
    function turnpage2 (evt:MouseEvent):void {
      screen_movie.gotoAndPlay ("page2");
      page1_btn.visible = false;
    page2_btn.visible= true; 
    page2_btn.addEventListener(MouseEvent.CLICK,turnpage3);
    function turnpage3 (evt:MouseEvent):void {
    screen_movie.gotoAndPlay ("page3");
    page2_btn.visible= false;
    p3_first_btn.visible= true;
    p3_first_btn.addEventListener(MouseEvent.CLICK,turnpage3a);
    function turnpage3a (evt:MouseEvent):void {
    screen_movie.gotoAndPlay ("page3a");
    p3_first_btn.visible= false;
    And, also the reason why I am setting the buttons to visible= true; at the start and visible= false; at the end is because I can only have one button for each page.
    Please help someone,
    Regards,
    Adam

  • I have an iphone 4, i connect it to my laptop using the usb and then when connecting to itunes it says my phone is not up to date with itunes yet i cannot find an update 11.1 for my phones itunes? someone please help me.. kind regards

    i have an iphone 4, i connect it to my laptop using the usb and then when connecting to itunes it says my phone is not up to date with itunes yet i cannot find an update 11.1 for my phones itunes? someone please help me.. kind regards

    Itunes 11.1 is for your computer, not your iphone
    It is required in order to sync with ios 7.

  • I can't forcequit firefox and shutdown my computer, nor can I open up any other programs or applications. Does anyone know how to fix this? please help this poor soul.

    I can't forcequit firefox and shutdown my computer, nor can I open up any other programs or applications. Does anyone know how to fix this? please help this poor soul.

    You can force quit applications
    >Force quit
    if that does not work you can force quit a computer shut down by hold the power button for an extended period.

  • I have windows 7 and every time I try to play or add a song. It says itunes has stopped working. Please help this is frustrating.

    I have windows 7 and every time I try to play or add a song. It says itunes has stopped working. Please help this is frustrating.

    a further message  box states that Data Execution Prevention has closed the program.
    Try updating your QuickTime to the most recent version. Does that clear up the DEP errors in iTunes?

  • HT201269 I forgot my password for Encrypt my Backup how can I reset that please help I really need it Urgently???

    I forgot my password for Encrypt my Backup how can I reset that please help I really need it Urgently?

    If you do not know the passcode then you cannot use the backup
    Sorry

  • Please help this: JNLP association extensions confict with arguments

    Hello, Please help this:
    I use <argument> tag to transfer some parameters to JWS application.
    I also use <associatio> tag to associate a specila file(such as .zzz) to JNLP. But when I doulbe click .zzz file, my application only get "-open" and file path as argument, those parameters in <argument> tag in my jnlp are lost!
    What should I do

    ..Is this a bug for JWS? No.
    ..association extensions tag conflicts with <argument>?Quoting the 'JNLP Specification', section 3
    'JNLP file', part 5 'Descriptor Information', under
    association element/mime-type attribute
    "An application making such a request
    should be prepared to have its main
    method invoked with the arguments
    -open filename and -print filename
    instead of any arguments listed with
    the application-desc element."

  • HT1339 my ipod nano 7th generation....works fine as long as it's on the docking station. when off the station, the display goes dark after a few seconds. it's fully charged. please help. this is the heartbeat of my business. thanks

    my ipod nano 7th generation....works fine as long as it's on the docking station. when off the station, the display goes dark after a few seconds. it's fully charged. please help. this is the heartbeat of my business. thanks

    In the worst case, it's still under warranty (all 7th gen nanos are still under one year from purchase).
    So, you disconnect it from power, and it almost immediately goes dead?  You can try a Restore... but it doesn't sound like the type of problem a Restore will fix.
    You should probably have it looked by Apple Tech Support.  If there's an Apple Store nearby, you can take it to the store's Genius Bar.  To avoid waiting, you can make a reservation at the store's web page
    http://www.apple.com/retail/

  • My Iphone 4s Will not delete the songs I want it to. I've tried Turning off "Show All Music" and then swiping left on the song to delete it, but it wont give me the option to delete the songs. Please help. (this is iOS.7 btw)

    I've tried Turning off "Show All Music" and then swiping left on the song to delete it, but it wont give me the option to delete the songs. Please help. (this is iOS.7 btw) It only does this for some of the songs, but the rest of them I can delete. This is really annoying, please help me ASAP. Thank yall for your time

    I've tried Turning off "Show All Music" and then swiping left on the song to delete it, but it wont give me the option to delete the songs. Please help. (this is iOS.7 btw) It only does this for some of the songs, but the rest of them I can delete. This is really annoying, please help me ASAP. Thank yall for your time

  • Someone please help this is getting irritating!

    how do I fix the system overload erra audio engin was not able to process all required data? someone please help this is getting irritating!

    You have a few options:
    1- Increase the Buffer Size in the Logic Devices Preferences to the maximum (1024)
    2- Freeze some Tracks with CPU intensive plugins
    3- Buy a faster computer
    Hope that helps
    Edgar Rothermich 
    http://DingDingMusic.com/Manuals/
    'I may receive some form of compensation, financial or otherwise, from my recommendation or link.'

  • Urgent please help, this program should work

    Urgent please help.
    I need to solve or I will be in big trouble.
    This program works at my home computer which is not networked.
    The hard disk was put onto another computer at another location whihc is networked. Here my program worked on Monday 14 october but since for the last two days it is not working without me changing any code. Why do I receive this error message???
    Error: 500
    Location: /myJSPs/jsp/portal-project2/processviewfiles_dir.jsp
    Internal Servlet Error:
    javax.servlet.ServletException
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:460)
    at jsp.portal_0002dproject2.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:162)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java)
    at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
    at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
    at org.apache.tomcat.core.Handler.service(Handler.java:235)
    at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
    at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
    at java.lang.Thread.run(Thread.java:536)
    Root cause:
    java.lang.NullPointerException
    at jsp.portal_0002dproject2.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:132)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java)
    at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
    at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
    at org.apache.tomcat.core.Handler.service(Handler.java:235)
    at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
    at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
    at java.lang.Thread.run(Thread.java:536)

    foolishmatt,
    The code is quit large.
    to understand the program I think all the code needs to be examined.
    I would need to send to you in an email.
    Here is my e-mail
    [email protected]
    if you contact me than I can send the code to you.
    Thank you in advance.

  • Activation Problem..i Have Registered for the devolopers account and also paid 99 dollars. how do i open my iphone now? please help. this is urgent!

    this morning my iphone showed up a activation problem then it told me to go to devoloper.apple.com and register for the ios developer program.. it costed me 99 dollars. but i did it.. just a moment ago.. how do i access my iphone now? please help me this is real urgent.

    this in my problem too apple say : ur request is pending now and it did not activated yet !    ?  
    what should i do?

  • Please help...Its really urgent- Which class to use for this?

    Can someone help me with this? I want to read characters from a file
    Ultimately I want to load some information from a text file which has information like this:
    0123456789
    0
    1
    4
    10
    X0123456789
    01202120212
    11202120212
    20212021202
    I want to load the information from X onwards .. all the rows and columns in a 2D array..
    I am not able to read the file at all ...
    I tried RandomAccessFile, BufferedReader..... They had problems.....what class sould I use.. any if you can give hints how I can reach X and start reading to 2d array...... It will be really very very helpful........
    Please help......

    Hi...
    See this is the partial code
    class LanguageRecognizer
         String word;
         String fileName;
         BufferedReader reader;
         char transitionTable[][];
         char letters[];
         char startState;
         char endStates[];
         int rows;
         int columns;
         public void getFileName(String fileName_)
              /********** Create File Objects to read file ******************************/
              try{
              this.fileName = fileName_;
              java.io.BufferedReader reader = new java.io.BufferedReader(new FileReader(fileName));
                   /***** Read File **************/
                   int i;
                   int X = 0;
                        /** as long as its not the EOF **/
                        while((i=reader.read()) != -1)
                             //Print all characters
                             System.out.println((char)i);
                             if (((char)i)=='X')
                                  X = i;
                                  System.out.println("X is at "+(char)i);                         
                             }//if
                        }//while          
              catch(Exception e)
                   e.printStackTrace();
              /**Call Prompt user and ask user to enter a word****************************/
                   promptUser();
         }//getFileName()When I say
    The while loop prints this file containing:
    0123456789
    0
    1
    4
    10
    X0123456789
    01202120212
    11202120212
    20212021202
    But it prints it in this format :
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    //Want to take this in the letter[]
    0 //want to take this as the startstate
    1 // This is the end state which could be more than one so in endState[]
    4 // This is the number of rows in the transition table
    1 // This is columns
    0
    //This is the transition table that I want in a 2D array......
    X // This is the X printed with the if() in the code
    X
    0
    1
    2
    3
    4
    5
    6
    7
    8
    9
    0
    1
    2
    0
    2
    1
    2
    0
    2
    1
    2
    1
    1
    2
    0
    2
    1
    2
    0
    2
    1
    2
    2
    0
    2
    1
    2
    0
    2
    1
    2
    0
    2
    So I want to capture each letter typed in arrays.......But I am not able to seperate them and get them in my datatypes... atleast not using this class BufferedReader.... so can I use this class and get it or which class can I use??

  • Please help, this is urgent

    Hi
    I have created a grid using JSP and HTML which has three columns and multiple rows. The cells are actually the text boxes and their names are EmpNo, Value1, and value2.
    And every row's column's control name is same.
    They display like this
    EmpNo Value1 Value2
    EmpNo Value1 Value2
    EmpNo Value1 Value2
    EmpNo Value1 Value2
    EmpNo Value1 Value2
    EmpNo Value1 Value2
    Can anybody guide me how can I access a value from a specific row and specific control. I am having problem because each column control name is same.
    I know its possible in ASP using count method, because in ASP when you create a control with a same name, the ASP generates an array and it keeps the array name as control name, so that you can access the value through its subscript number. I was trying to do the same thing in JSP but couldn't do that.
    Please help me, I will really appreciate that.
    Thanks

    Can anybody guide me how can I access a value from a
    specific row and specific control. I am having
    problem because each column control name is same.
    I know its possible in ASP using count method,
    because in ASP when you create a control with a same
    name, the ASP generates an array and it keeps the
    array name as control name, so that you can access
    the value through its subscript number. I was trying
    to do the same thing in JSP but couldn't do that.HTML creates the array, so it works the same in JSP. Need to see your code to suggest why this might not be working for you.

Maybe you are looking for

  • Re-associating previously purchased iTunes apps, etc with different Apple ID?

    , I want to get a brand new Apple ID to replace my current MobileMe address which I will convert to iCloud just for transition purposes and until my contacts update to my new email. I want to be able to ultimately eliminate my old .mac and .me addres

  • Payment term baseline date in SD

    Hi, all:    In the configuration of payment term, there are four criteria for baseline date:    no defalut date; entry date; docuemnt date; posting date.    For SD receivable items, what the "entry date" and "docuemtn date" respectively stand for whe

  • Character encoding form input

    Hi           Using WebLogic 6.1.           I have a JSP containing a HTML form with some input fields. The user           should be able to edit non-ASCII characters input fields. If he does           that now, I will retrieve some kind for encoding

  • Sending large array of bytes

    I'm unable to send more than 4 MB byte array with JDeveloper 10g / OC4J. It seems to croak the OC4J. Is there a JVM setting or something else that I can increase that will fix this?

  • How do I set up for extending my non-apple wi-fi network with Airport Express?

    I have Trendnet router that I use for providing wi-fi capabilities in my home.  The problem is that it is set up in my basement and it doesn't extend to the back of the house.  I'm also having problems setting up my wireless printer with this setup.