Loading

Exercise Number: 1

Question

Create a program to store prices of items in a shopping cart using an ArrayList<Double>. The program should:

  • Add item prices (double) to the cart.
  • Automatically convert primitive double to Double (autoboxing).
  • Calculate the total cost using unboxing.
  • Print all prices and the total cost.