Question: in java and with testing plz Problem 2 1. A supermarket is selling some items. It needs to know the profit it is making after

 in java and with testing plz Problem 2 1. A supermarketin java and with testing plz

Problem 2 1. A supermarket is selling some items. It needs to know the profit it is making after selling each day. Help the supermarket owner by building an application to do that. Create a class named "Item" which has the following fields. Item number : String ii. Number of items sold: int purchase price : double iv. selling Price : double 2. Write two constructors for the class Item: one without parameters, and another with parameters to fill all its attributes. 3. Write an accessor and a mutator method for each attribute. Make all methods public. 4. Write a "toString()" method to display the attributes of the class "Item Testing: 1. Write a Java program "TestSupermarket". In the main method, open the file ItemInventory.txt and read the information about each item: ABC1234 20 35.5 40.5 XYZ5434 30 200 230 WQE767 250 100 90 TRY1290 100 25 2. For each item, an instance of the class "Item" is created and the profit (or loss) is calculated. 3. Write each instance created to an output file, "Items.out" using a Print Writer Java class. Write the profit or loss beside each item. 4. At the end, write the total profit or loss for the supermarket on this day. 30 Have fun! N

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!