1) I need to create a class, named ReadProduct. It has the following two attributes: | Cheap Nursing Papers

1) I need to create a class, named ReadProduct. It has the following two attributes:

1) I need to create a class, named ReadProduct.java. It has the following two attributes:

• an ArrayList object, listProduct, which will contain Product objects and

• a HashMap object, mapCodeProduct, in which the key is product code, and the value is the product object.

2) The class has a method, readProductFile(), that reads products.txt line by line(refer to chapter 18 for the text file’s format and sample content). Using information from each line, it creates a Product object and stores the object in the listProduct ArrayList. This class contains another method, getListProduct(), which returns the listProduct ArrayList object.

3) When reading each line, it stores the product code and the product object as a record to the mapCodeProduct HashMap object. It provides another method, getMapCodeProduct(), which returns the mapCodeProduct HashMap object.

4) I need to create another class, ProductApp.java, which has a main method to test the ReadProduct class.

5) Products.txt file would be comma-separated text file. Each row represents one product as follows:

Wuth,Wuthering Heights,49.50

Mbdk, Moby Dick,33.67

Wooz,Wizard of Oz, 44.29

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp