Skip to content
Advertisement

Display all the items I have ordered

How to display all the items I have ordered in “Sales Report File”? Like whenever I ordered 2 cookies, It will display on the Sale Report file. I have this code currently..

JavaScript

Advertisement

Answer

If you want like a text list of what you have ordered, you can simply create an ArrayList<String> and every time you click on a product you do list.add('Cookies') or whatever the product is, depending on the switch. In this way you have a list ordered by time-ordered products.

The output would be something like:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement