errors in Inventory Program Part 2

Inventory Program Part 2

Posted 19 June 2008 - 10:24 AM

Please help, I am really lost on this program, here is the code I have and the error states "C:\Documents and Settings\Tammy\My Documents\NetBeansProjects\MyDvds.java\src\Inventory.java:61: '}' expected" this is for line 60 of the code.

Please let me know if you need all of the code for this assignment, as I am not sure. This is the part of the code that keeps giving me one error when I try to build the main project. Thanks for the help.

Replies To: Inventory Program Part 2

Re: Inventory Program Part 2

Posted 19 June 2008 - 10:43 AM

Sorry, I am new to this. This assignment is to modify the Inventory Program so the application can handle multiple items and use an array to store the items. The output should display the information one product at a time; including the item number, name of the product, the number of units in stock, the price of each unity, and the value of the inventory of that product. In addition, the output should display the value of the entire inventory. Create a method to calculate the value of the entire inventory. Create another method to sort the array items by the name of the product.

Re: Inventory Program Part 2

Posted 19 June 2008 - 11:24 AM

you are missing a closing bracket somewhere in your code. What i would suggest is go through your code line by line. Find every opening brace and then find its counterpart. Also you can post your code in full that way we can look at everything.

I have gone through the code again and I am back to the original error message:
C:\Documents and Settings\Tammy\My Documents\NetBeansProjects\MyDvds.java\src\Inventory.java:62: '}' expected

1 error
BUILD FAILED (total time: 0 seconds)

I have noticed that I have an extra line of text in the code:
public void addProduct (Product Item) {
Product item;

If I remove Product item; I get a cannot find symbol error and a choice to create a field item, parameter item, or local variable item. This error in the form of a lightbulb is on the line that contains: