
Shopping cart Create 3 shopping carts from a Cart class. Each class should have four items in it, a title, a price for the 4 items and the number of each. Your shopping cart should use private variables, so use getter and setter methods to access the items (variables) in your Cart Object. After you have created three Cart objects with four items each, you should print the cart contents. Use a method called displayCart() to make it easier to print out the items for each shopping cart. A sample output for the first cart is given below and you may choose your preferred way to show the output of the 3 carts. ***Cart 1**** ---------- Your Shopping Cart ---------- 1. Paper 4.99 3 2. Pencils 1.49 2 3. Pens 2.39 2
Total: 182.69
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.