Error: end public class Inventory3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TinaJones095
    New Member
    • Oct 2007
    • 8

    Error: end public class Inventory3

    Hello I am going to give a program that I have done, but I have to modifiy it, but I need help okay can you help ?
    Here the program I need help to straighten up below:

    the Java error is right at the point is at the end of the program.

    [CODE=Java]
    //week 6 Inventory3
    // by Tina Jones
    // IT 215
    // october 07/2007
    import java.util.Scann er;
    public class Inventory3
    {
    class restockfee3
    {
    //Inventoryprogra mpart3
    // Created on October 5, 2007, 10:19 PM
    //To change this template, choose Tools | Template Manager and open the template in the editor.

    {
    // Creat a calculation for restock fee
    //Create a new instance of Inventoryprogra mpart2
    // Create private varibles
    //Create a constructor Inventory2 varibles
    // private main method begins program execution
    // Create a new instance for class Inventory2
    // create a new instance for ProductGUI1
    class array1
    {
    public static void main ( String args[] )
    {
    // array of stock number
    product array []={ doll ,computer , car, list};
    //array of product
    number array[]={ 1 , 2 , 3 , 4};
    // array of item number
    value array []={ $29, $600, $23};
    // array of price
    stock array []={ 43436, 65656,76767};
    //array of stock number
    class Sortmethod1
    {
    // Create private varibles
    //Create a constructor sortmethod1 varibles
    // private main method begins program execution
    // Create a new instance for sortmethod1
    // create a new instance for arrayGUI1
    private String name; //sets varialbe
    private int Number; //sets inventory number
    private int units = Numbers ;// sets Unit number
    private double Stock = numbers; // sets the stock amount
    private double Price = dollars;//sets price with restock fee of 5%
    private double invPrice;
    //Create a constructor array list1 varibles
    // private main method begins program execution
    // Create a new instance for array list1
    // create a new instance for array listGUI1
    // getmethod for array list GUI
    private static void main ( String name, int number, int units, double stock, double price, double invprice[])
    {
    product name = name;// getproduct name
    item number = number;//getitem number
    units = number;// getunits number
    stock = number;// getstock number
    price = number;// getprice number
    restock fee= number;// getrestock fee
    Scanner input = new Scanner( System.in ); //user input
    // Create a sort method for product name array list
    System.out.prin tf("%s\n%s\n"," use sort method for Product name array");
    System.out.prin tf("Please Enter Name of Product");
    String name = input.nextLine( );
    // array of product
    // start array constructor
    System.out.prin tf("\nList of Products");
    System.out.prin tf("%s\n%s\n"," use sort method for Item number array");
    System.out.prin tf("Please Enter Item number");//Needs be a number
    double number = input.nextDoubl e();
    System.out.prin tf("%s\n%s\n"," use sort method for product price array");
    System.out.prin tf("Please Enter Product Price");//Needs be a number
    double price = input.nextDoubl e();
    // start array constructor
    //perform verious opreations of the data
    //create a list method for array
    // create a sort method for stock number array list
    System.out.prin tf("%s\n%s\n"," use sort method for stock array");
    System.out.prin tf("Please Enter Stock Number");// Need be a number
    double number = input.nextDoubl e();
    // create a calculation for restock fee of 5%
    //start calculation constructor
    System.out.prin tf("%s\n%s\n"," user enters a restock fee is: 5%");
    double fee = input.nextDoubl e();
    //Output Display
    System.out.prin tf("Product name:%s\n","nam e");
    System.out.prin tf("Item number:%s\n","n umber");
    System.out.prin tf("Item price:%s\n","pr ice");
    System.out.prin tf("Stock number:%s\n","n umber");
    System.out.prin tf("use a sort method for array lists:%s\n","al l array list a-z listings");
    System.out.prin tf("A Restock fee:%s\n","calc ulation fee");
    }// end sub public class sortmethod
    ) // end public class Inventory3[/CODE]
    the line error that I am gettins here: ) // end public class Inventory3

    so far do you have any sugguestions how to improve my program?
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Hi Tina and welcome to thescripts.

    I have added code tags to your code and changed the title to make it more readable.

    I am going to move it over to the Java forum where our Java experts will try to assist you.

    Mary

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      However, I can actually guess at your problem. You have opened a number of classes including Main but you haven't closed them all.

      Comment

      • TinaJones095
        New Member
        • Oct 2007
        • 8

        #4
        okay but this just one example of the errors I am getting. I am trying to get it right

        Comment

        • MMcCarthy
          Recognized Expert MVP
          • Aug 2006
          • 14387

          #5
          Originally posted by TinaJones095
          okay but this just one example of the errors I am getting. I am trying to get it right
          You can't pinpoint the errors unless you close the classes properly. Go through the code an put closing brackets in where required before proceeding. Then repost with the errors you are now getting. The Java experts will take it from there.

          Comment

          • TinaJones095
            New Member
            • Oct 2007
            • 8

            #6
            Originally posted by mmccarthy
            However, I can actually guess at your problem. You have opened a number of classes including Main but you haven't closed them all.
            Do you think You can help deveolpe a Inventory program that can be with these things
            [ Product array]
            the products are[dolls] [computers] [cars]
            need a product class program.
            then Need a
            [Item number array]
            numbers were in the program that I gave you.
            [price array]
            also need a
            [stock array]
            then need a format to do a restock fee of 5%
            then need a format to do a sort method.
            I will need some type of super class
            I need a Item number program that will let the user to type in the product name, item number the price, and to list stock as display, then I need to include a restock fee of 5%. I also have to have a sort method. Next I have to have a super class.
            then I need a logo or logo obect for the inventory program.I am needing to work on Inventory 4 for my class. But because of these errors I am needing help.

            Comment

            • TinaJones095
              New Member
              • Oct 2007
              • 8

              #7
              Originally posted by mmccarthy
              You can't pinpoint the errors unless you close the classes properly. Go through the code an put closing brackets in where required before proceeding. Then repost with the errors you are now getting. The Java experts will take it from there.
              I do not know where start on closing the classes can you help me here go though each part.

              Comment

              • TinaJones095
                New Member
                • Oct 2007
                • 8

                #8
                Originally posted by TinaJones095
                I do not know where start on closing the classes can you help me here go though each part.
                Okay [Error codes on Lines 38 41 44 47 50 53 138] of the reposted program okay below here is the program/


                //week 6 Inventory3
                // by Tina Jones
                // IT 215
                // october 07/2007
                import java.util.Scann er;
                public class Inventory3
                {
                class restockfee3
                {
                }
                class Inventoryprogra mpart2
                {
                }
                class array1
                {
                }
                public static void main ( String args[] )
                {
                // array of stock number
                product array []={ doll ,computer , car, list};
                //array of product
                number array[]={ 1 , 2 , 3 , 4};
                // array of item number
                value array []={ $29, $600, $23};
                // array of price
                stock array []={ 43436, 65656,76767};
                }
                //array of stock number
                class Sortmethod1
                {
                }
                // Create private varibles
                //Create a constructor sortmethod1 varibles
                // private main method begins program execution
                // Create a new instance for sortmethod1
                // create a new instance for arrayGUI1
                {
                private String name; //sets varialbe
                }
                {
                private int Number; //sets inventory number
                }
                {
                private int units = Numbers ;// sets Unit number
                }
                {
                private double Stock = numbers; // sets the stock amount
                }
                {
                private double Price = dollars;//sets price with restock fee of 5%
                }
                {
                private double invPrice;
                }
                //Create a constructor array list1 varibles
                // private main method begins program execution
                // Create a new instance for array list1
                // create a new instance for array listGUI1
                // getmethod for array list GUI
                private static void main ( String name, int number, int units, double stock, double price, double invprice[])
                {
                product name = name;// getproduct name
                item number = number;//getitem number
                units = number;// getunits number
                stock = number;// getstock number
                price = number;// getprice number
                restock fee= number;// getrestock fee
                }
                {
                Scanner input = new Scanner( System.in ); //user input
                }
                // Create a sort method for product name array list
                {
                System.out.prin tf("%s\n%s\n"," use sort method for Product name array");
                }
                {
                System.out.prin tf("Please Enter Name of Product");
                }
                {
                String name = input.nextLine( );
                }
                // array of product
                // start array constructor
                {
                System.out.prin tf("\nList of Products");
                }
                {
                System.out.prin tf("%s\n%s\n"," use sort method for Item number array");
                }
                {
                System.out.prin tf("Please Enter Item number");//Needs be a number
                double number = input.nextDoubl e();
                }
                {
                System.out.prin tf("%s\n%s\n"," use sort method for product price array");
                }
                {
                System.out.prin tf("Please Enter Product Price");//Needs be a number
                double price = input.nextDoubl e();
                }
                // start array constructor
                //perform verious opreations of the data
                //create a list method for array
                // create a sort method for stock number array list
                {
                System.out.prin tf("%s\n%s\n"," use sort method for stock array");
                }
                {
                System.out.prin tf("Please Enter Stock Number");// Need be a number
                double number = input.nextDoubl e();
                }
                // create a calculation for restock fee of 5%
                //start calculation constructor
                {
                System.out.prin tf("%s\n%s\n"," user enters a restock fee is: 5%");
                double fee = input.nextDoubl e();
                }
                //Output Display
                {
                System.out.prin tf("Product name:%s\n","nam e");
                }
                {
                System.out.prin tf("Item number:%s\n","n umber");
                }
                {
                System.out.prin tf("Item price:%s\n","pr ice");
                }
                {
                System.out.prin tf("Stock number:%s\n","n umber");
                }
                {
                System.out.prin tf("use a sort method for array lists:%s\n","al l array list a-z listings");
                }
                {
                System.out.prin tf("A Restock fee:%s\n","calc ulation fee");
                }
                } // end sub public class restock fee
                } // end Inventory3

                Comment

                • TinaJones095
                  New Member
                  • Oct 2007
                  • 8

                  #9
                  I need some help building a better program can you or anyone help me?

                  Comment

                  • TinaJones095
                    New Member
                    • Oct 2007
                    • 8

                    #10
                    Originally posted by TinaJones095
                    I need some help building a better program can you or anyone help me?
                    I tell you what I will give you the Inventory 1, 2, 3, and possiblity 4 can you help me in getting this done by tommow it is passed due, please help!!!

                    //Inventory1
                    //IT 215
                    //by Tina Jones
                    import java.util.Scann er;

                    public class Inventory1 {
                    public static void main( String name, int number, double units, double stock, double price, double invprice[])
                    {
                    public String name();
                    public int Number; //sets inventory number
                    public int units = Numbers ;// sets Unit number
                    public double Stock = numbers; // sets the stock amount
                    public double Price = dollars;//sets price of
                    public double invPrice;
                    }
                    {
                    system.out.prin tf("Please Enter Product Name");
                    string name = input.nextLine( );
                    System.out.prin tf("Please Enter Item number");
                    double number = input.nextDoubl e();
                    System.out.prin tf("Please Enter Stock Number");// Need be a number
                    double number = input.nextDoubl e();
                    }
                    //Output Display
                    System.out.prin tf("Product name:%s\n","nam e");
                    System.out.prin tf("Item number:%s\n","n umber");
                    System.out.prin tf("Item price:%s\n","pr ice");
                    System.out.prin tf("Stock number:%s\n","n umber");
                    }// end class Inventory1
                    [help]
                    error on 9-13,25-27

                    Comment

                    • TinaJones095
                      New Member
                      • Oct 2007
                      • 8

                      #11
                      Originally posted by TinaJones095
                      I tell you what I will give you the Inventory 1, 2, 3, and possiblity 4 can you help me in getting this done by tommow it is passed due, please help!!!

                      //Inventory1
                      //IT 215
                      //by Tina Jones
                      import java.util.Scann er;

                      public class Inventory1 {
                      public static void main( String name, int number, double units, double stock, double price, double invprice[])
                      {
                      public String name();
                      public int Number; //sets inventory number
                      public int units = Numbers ;// sets Unit number
                      public double Stock = numbers; // sets the stock amount
                      public double Price = dollars;//sets price of
                      public double invPrice;
                      }
                      {
                      system.out.prin tf("Please Enter Product Name");
                      string name = input.nextLine( );
                      System.out.prin tf("Please Enter Item number");
                      double number = input.nextDoubl e();
                      System.out.prin tf("Please Enter Stock Number");// Need be a number
                      double number = input.nextDoubl e();
                      }
                      //Output Display
                      System.out.prin tf("Product name:%s\n","nam e");
                      System.out.prin tf("Item number:%s\n","n umber");
                      System.out.prin tf("Item price:%s\n","pr ice");
                      System.out.prin tf("Stock number:%s\n","n umber");
                      }// end class Inventory1
                      [help]
                      error on 9-13,25-27
                      Here is Part 2[Help]

                      //Inventoryprogra mpart2
                      //It 215
                      //by Tina Jone
                      // Created on October 5, 2007, 10:19 PM
                      //To change this template, choose Tools | Template Manager and open the template in the editor.
                      import java.util.Scann er;
                      class Inventoryprogra mpart2
                      {
                      //Creates a new instance of Inventoryprogra mpart2
                      // Create private varibles
                      //Create a constructor Inventory2 varibles
                      // private main method begins program execution
                      // Create a new instance for class Inventory2
                      // create a new instance for ProductGUI1
                      public class Sortmethod1
                      {
                      // Create private varibles
                      //Create a constructor sortmethod1 varibles
                      // private main method begins program execution
                      // Create a new instance for sortmethod1
                      // create a new instance for arrayGUI1
                      private String name; //sets varialbe
                      private int Number; //sets inventory number
                      private int units = Numbers ;// sets Unit number
                      private double Stock = numbers; // sets the stock amount
                      private double Price = dollars;//sets price of
                      private double invPrice;
                      }
                      //Create a constructor array list1 varibles
                      // private main method begins program execution
                      // Create a new instance for array list1
                      // create a new instance for array listGUI1
                      // getmethod for array list GUI
                      private static void main ( String name, int number, int units, double stock, double price, double invprice[])
                      {
                      product name = name;// getproduct name
                      item number = number;//getitem number
                      units = number;// getunits number
                      stock = number;// getstock number
                      price = number;// getprice number
                      }
                      {
                      Scanner input = new Scanner( System.in ); //user input
                      // Create a sort method for product name array list
                      System.out.prin tf("%s\n%s\n"," use sort method for Product name array");
                      System.out.prin tf("Please Enter Name of Product");
                      String name = input.nextLine( );
                      }// array of product
                      }// start array constructor
                      {
                      arr[2]= doll;
                      arr[4]=car;
                      arr[6]=computer;
                      arr[0]=list;
                      }
                      {
                      int productarray[]= {0,2,4,6};
                      // perform verious opreation of the data
                      //output product array
                      // call method put in products in a list method
                      System.out.prin tf("\nList of Products");
                      //Create a sort method for Item number array list
                      System.out.prin tf("%s\n%s\n"," use sort method for Item number array");
                      System.out.prin tf("Please Enter Item number");//Needs be a number
                      double number = input.nextDoubl e();
                      //array of item number
                      //start array constructor
                      arr[12]=43434;
                      arr[14]=65656;
                      arr[16]=76767;
                      arr[10]=list;
                      int itemnumberarray[]= {10,12,14,16,};
                      //perform verious opreations of the data
                      //output item array
                      //call method put in item number in a list method
                      //Create a sort method for product price array list
                      System.out.prin tf("%s\n%s\n"," use sort method for product price array");
                      System.out.prin tf("Please Enter Product Price");//Needs be a number
                      double price = input.nextDoubl e();
                      // array of price number
                      // start array constructor
                      arr[22]=$29;
                      arr[24]=$23;
                      arr[26]=$620;
                      arr[30]=list;
                      int productpricearr ay[]= {22,24,26,30};
                      //perform verious opreations of the data
                      //output product price array
                      //call method put in product price number in a list method
                      // create a sort method for stock number array list
                      System.out.prin tf("%s\n%s\n"," use sort method for stock array");
                      System.out.prin tf("Please Enter Stock Number");// Need be a number
                      double number = input.nextDoubl e();
                      // array of stock number
                      // start array constructor
                      arr[1]=22;
                      arr[3]=24;
                      arr[5]=26;
                      arr[7]=list;
                      int Stocknumberarra y[]= {1,3,5,7};
                      //perform verious opreations of the data
                      //output product stock array
                      //call method put in product stock number in a list method
                      //Output Display
                      System.out.prin tf("Product name:%s\n","nam e");
                      System.out.prin tf("Item number:%s\n","n umber");
                      System.out.prin tf("Item price:%s\n","pr ice");
                      System.out.prin tf("Stock number:%s\n","n umber");
                      System.out.prin tf("use a sort method for array lists:%s\n","al l array list a-z listings");
                      }
                      }// end public class Sortmethod1
                      then I have given you part 3 [Help on it too]


                      Part 4 is next one need [help]
                      // week 8 Inventory Program Part 4.5
                      //By Tina Jones
                      //IT 215
                      import java.util.Scann er;
                      public class Inventory4{
                      private String invname= ("Item Names"); //sets varialbe
                      private int invNumber =("Numbers"); //sets inventory number
                      private int units = ("Numbers");// sets Unit number
                      private double invQuantity =("In Stock");// sets the stock amount
                      private double itemPrice =("Price $");//sets price of
                      private double invPrice;
                      private int invNumber =("class selection");//set user to, one item at a time}
                      public static void main( String name, int number, double quantity, double price) {
                      invName = name;
                      invNumber = number;
                      invQuantity = quantity;
                      itemPrice = price;
                      }{
                      System.out.prin tln("%s\n%s\n", "enter one selection at a time");
                      System.out.prin tln("%s\n%s\n", "enter user selection options");
                      System.out.prin tln("%s\n%s\n", "enter calculation for inventory program");
                      System.out.prin tln("%s\n%s\n", "Display output of private String name one at a time");
                      }
                      {
                      Scanner input=new Scanner(System. in);//User Input
                      String invname=input.n extLine();
                      System.out.prin tln("My`E-Store Product Inventory Program Part 3");
                      System.out.prin tln("Enter Product Name Product ID #class Case 1-10 as a String");
                      System.out.prin tln("Enter Product Name Product ID#class Case Price as real:$");
                      System.out.prin tln("Enter Product ID Class Case Units in Stock as interg");
                      System.out.prin tln("Enter Product Name ID #class");
                      System.out.prin tln(" Enter Calculation Program to calculate The value of inventory Price$ Total Value as string");
                      System.out.prin tln(" Enter Total Value = New Total Value");
                      System.out.prin tln(" Set Calculation For New Total Value as realInput New Total Value");
                      System.out.prin tln(" Input Product name as a subclass");
                      System.out.prin tln("Display output of private String name one at a time");
                      System.out.prin tln("Calculatio n of Total Value: as real");
                      System.out.prin tln("Enter Total Value= New Total Value");
                      System.out.prin tln("Calculatio n as real $ times the stock number");
                      System.out.prin tln("get calculation total value");
                      System.out.prin tln("Set New Total Value to Charge a restock fee of 5% of the Total Value");
                      System.out.prin tln("Enter class 1 as Glass Castle Product Name Product #29500;Price $30;In Stock 10");
                      System.out.prin tln("Enter class 2 as Frog Product Name Product #39600;Price$42 ;In Stock 42");
                      System.out.prin tln("Enter class 3 as Frog Rain GauageProduct Name Product #30071;Price$12 ;In Stock 12");
                      System.out.prin tln("Enter class 4 as Porcelin Doll Product Name Product #29583;Price$14 ;In Stock 14");
                      System.out.prin tln("Enter class 5 as Alphabtic Product Name Product #29533;Price$20 0;In Stock 12");
                      System.out.prin tln("Enter class 6 as Alphabtic Train Product Name Product #28880;Price$23 ;In Stock 23");
                      System.out.prin tln("Enter class 7 as Pizza Stone Product Name Product #245444;Price$1 7;In Stock 17");
                      System.out.prin tln("Enter class 8 as AA Battiers Product Name Product #55555;Price$12 ;In Stock 12");
                      System.out.prin tln("Enter class 9 as Flash Light Product Name Product #44444;Price$32 ;In Stock 13");
                      System.out.prin tln("Enter class 10 as Null Product Name Product is invaild entry return user to main entry");
                      }
                      {
                      Scanner input=new Scanner(System. in);//If 0=Null return user to main entry
                      int number= input.nextLine( );
                      }
                      {
                      Scanner input= new Scanner(System. in);//User set up options in place
                      double quanitity= input.nextLine( );
                      }
                      {
                      System.out.prin tln("Set class Product Name #");
                      }
                      {
                      Scanner input= new Scanner(System. in);// User make set option in place
                      double price= input.nextLine( );
                      }
                      {
                      Scanner input= new Scanner(System. in);//use input the inventory price
                      double invprice=input. nextLine();
                      }
                      {
                      String=getInvNa me();
                      }
                      {
                      Scanner input= new Scanner(System. in);// user input the units
                      int units=input.nex tLine();
                      }
                      {
                      return invName;
                      getInvNumber();
                      return invNumber;
                      getInvQuantity( );
                      return invQuantity;
                      getItemPrice();
                      return itemPrice;
                      getselection();
                      return selection;
                      }

                      private class LabelFrame extends JFrame
                      {
                      private JLabel label1; // JLabel with just text
                      private JLabel label2; // JLabel constructed with text and icon
                      private JLabel label3; // JLabel with added text and icon
                      // LabelFrame constructor adds JLabels to JFrame}
                      private LabelFrame(){
                      super( "Testing JLabel" );
                      setLayout(new FlowLayout() ); // set frame layout
                      // JLabel constructor with a string argument}
                      label= new JLabel( "Label with text" );
                      label1.setToolT ipText( "This is label1" );
                      add( label1 ); // add label1 to JFrame
                      // JLabel constructor with string, Icon and alignment arguments
                      Icon bug = new ImageIcon( getClass().getR esource( "bug1.gif" ) );
                      label2 = new JLabel( "Label with text and icon", bug,
                      SwingConstants. LEFT );
                      label2.setToolT ipText( "This is label2" );
                      add( label2 ); // add label2 to JFrame
                      label3 = new JLabel(); // JLabel constructor no arguments
                      label3.setText( "Label with icon and text at bottom" );
                      label3.setIcon( bug ); // add icon to JLabel
                      label3.setHoriz ontalTextPositi on( SwingConstants. CENTER );
                      label3.setVerti calTextPosition ( SwingConstants. BOTTOM );
                      label3.setToolT ipText( "This is label3" );
                      }//
                      }// end public class Invertory4
                      {This is the one I have to do by tomorrow.]

                      Comment

                      • JosAH
                        Recognized Expert MVP
                        • Mar 2007
                        • 11453

                        #12
                        Please stop dumping all that code over and over again. And if you must post
                        some code please use the code tags for readability reasons.

                        Your compiler emits error diagnostic messages not for fun: i.e. you're supposed
                        to read those messages and understand why the compiler showed such a
                        message; it is not an indication that you should pollute this forum with vague
                        complaints.

                        For starters: the curly braces in your program don't match up; first fix that and
                        then come back again.

                        kind regards,

                        Jos

                        Comment

                        Working...