Search:

Type: Posts; User: aldos7

Search: Search took 0.34 seconds.

  1. Re: Default Write a Java program to simulate an online shopping cart.

    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...
  2. Re: Default Write a Java program to simulate an online shopping cart.

    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:...
  3. Re: Default Write a Java program to simulate an online shopping cart.

    So all three lines of that code should go in the highlighted section:

    2558
  4. Re: Default Write a Java program to simulate an online shopping cart.

    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    product cannot be resolved to a variable
    The constructor CartItem(String) is undefined

    at...
  5. Re: Default Write a Java program to simulate an online shopping cart.

    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...
  6. Re: Default Write a Java program to simulate an online shopping cart.

    How do I change it to use one of the existing CartItem constructors?
  7. Re: Default Write a Java program to simulate an online shopping cart.

    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...
  8. Re: Default Write a Java program to simulate an online shopping cart.

    I am trying to figure out case 4 but I am getting this error:

    2554
  9. Re: Default Write a Java program to simulate an online shopping cart.

    I never said I was a student. But thank you for your help. I will let you know if I have any more questions.
  10. Write a Java program to simulate an online shopping cart.

    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...
  11. Re: Default Write a Java program to simulate an online shopping cart.

    I am still trying to change the code to have it read a string. Could you please give me the code for that?
  12. Re: Default Write a Java program to simulate an online shopping cart.

    i know what they are but i do not know how to apply them to this particular program. Could you show me how?
  13. Re: Default Write a Java program to simulate an online shopping cart.

    What do i do for the getter setter methods?
  14. Re: Default Write a Java program to simulate an online shopping cart.

    which class am i looking for?
  15. Re: Default Write a Java program to simulate an online shopping cart.

    im really not sure what that means. Could you be more specific or help provide me with the code?

    thanks !
  16. Re: Default Write a Java program to simulate an online shopping cart.

    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
  17. Re: Default Write a Java program to simulate an online shopping cart.

    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"...
  18. Re: Default Write a Java program to simulate an online shopping cart.

    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...
  19. Re: Default Write a Java program to simulate an online shopping cart.

    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...
  20. Default Write a Java program to simulate an online shopping cart.

    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...
Results 1 to 20 of 20