Hello
java friends, I'm new to the concept of ArrayList and I want to solve this problem in my code.
my main problem:
I don't know how to sort itemA and itemB to appear only once then It will just add the total prices together.
this is the behavior of my code:
C:\Documents and Settings\Drew\Desktop>java ReceiptCode
Enter Company Name
ABC Co
Enter STREET ADDRESS
123 Main Street
Enter CITY, STATE, ZIP
City, State, 123456
How many items did you order?
4
Enter Item Name
itemA
Enter Quantity?
2
Enter Price?
2
Enter Item Name
itemB
Enter Quantity?
1
Enter Price?
4
Enter Item Name
itemA
Enter Quantity?
4
Enter Price?
2
Enter Item Name
itemB
Enter Quantity?
1
Enter Price?
4
ABC Co
123 Main Street
City, State, 123456 10/26/2014
16:29
------------------------------
2 x itemA : 2.0$
------------------------------
1 x itemB : 4.0$
------------------------------
4 x itemA : 2.0$
------------------------------
1 x itemB : 4.0$
------------------------------
I don't know how to sort itemA and itemB to appear only once then It will just add the total prices together.
here is my sourcecode:
ReceiptCode.java
Items.java