Ok I did that but here is what happens when I run the program and choose option 1:
Menu - Managing a List
1 Add an item to your cart
2 Remove an item from your cart
3 View the items in your...
Type: Posts; User: aldos7
Ok I did that but here is what happens when I run the program and choose option 1:
Menu - Managing a List
1 Add an item to your cart
2 Remove an item from your cart
3 View the items in your...
Here is what I did for case 1 and this seemed to work:
item = new CartItem(product, quantity, price);
However for case 2, it gives me an error saying:
Exception in thread "main" java.lang.Error:...
So all three lines of that code should go in the highlighted section:
2558
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
product cannot be resolved to a variable
The constructor CartItem(String) is undefined
at...
Here is the code for the CartItem class. In the image, you can see the constructors. I have tried using them but it is not working. I think i am writing the statement wrong. How would I write a new...
How do I change it to use one of the existing CartItem constructors?
Here is the first error I am getting:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The constructor CartItem(String) is undefined
The constructor...
I am trying to figure out case 4 but I am getting this error:
2554
I never said I was a student. But thank you for your help. I will let you know if I have any more questions.
Hello, I need some help finishing this shopping cart java program. Here are the directions:
Project description: Write a Java program to simulate an online shopping cart.
An online shopping...
I am still trying to change the code to have it read a string. Could you please give me the code for that?
i know what they are but i do not know how to apply them to this particular program. Could you show me how?
What do i do for the getter setter methods?
which class am i looking for?
im really not sure what that means. Could you be more specific or help provide me with the code?
thanks !
It gave me the error because I did not enter an integer, I entered the word "jeans"
So like you said, I have to change the code to have it read a string. How do I do that?
thanks for your help
How do I change the code to have it read a string?
Also, here is the error when I choose option 2. I assume it is the same error, but for line 66:
Exception in thread "main"...
Here is what happens when I run the program and choose option 1:
Menu - Managing a List
1 Add an item to your cart
2 Remove an item from your cart
3 View the items in your cart
4 Exit and add...
i believe that most of the work needs to be done in the CartItem file. I need to write getter setter public methods for each instance data, write code for toString method, and also the constructor...
Hello, I need some help finishing this shopping cart java program. Here are the directions:
Project description: Write a Java program to simulate an online shopping cart.
An online shopping...