Question: Write a Java program that uses ArrayList and Iterator. It should input from user the names and prices of products or iterns in a loop

Write a Java program that uses ArrayList and Iterator. It should input from user the names and prices of products or iterns in a loop and add into ArrayList. Finally, it should use Iterator to display the data in a proper format. [Hint:Lecture 02: Slide 81 [Waring. Cheating in homework will result in zero marks ... (nanine programe will get 03] Sample output: List of my ltems Enter name and price [item\# 0] Drill Machine 22.5 Do you want to add another item (y)? y Enter name and price [itemA 1] Plastic Chair 21.1 Do you want to add another item (y) ? y Enter name and price [item\# 2] Steel Hamer 23.7 Do you want to add another item (y) ? n Here is the data you entered: 0. Drill Machine, 22.5 1. Plastic Chair. 21.1 2. Steel Hamer , 23.7 For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
