Question: Java HW Help!! Under the com package create an ItemSale class. It should have the following class variables: saleld (int), itemName (String), purchase Price (double),

Java HW Help!!  Java HW Help!! Under the com package create an ItemSale class.
It should have the following class variables: saleld (int), itemName (String), purchase

Under the com package create an ItemSale class. It should have the following class variables: saleld (int), itemName (String), purchase Price (double), sellPrice (double) items Sold (int). Create an Item Demo class with a main method. In the main method, create three items. Make only two items have the same itemName. Create the following methods: Create a method called getMostExpensiveltem that passes in three ItemSale objects and returns the name of the most expensive item (Note: if there are two items that have the same price, it will just return the name of the first item). Create a method called getLargestProfititem that passes in three ItemSale objects and returns the name of the item that has the highest profit. To calculate profit, it's (sellPrice-purchasePrice) * itemsSold. (Note: if there are two items that have the same profit, it will just return the name of the first item). Test all methods in the main method. Create a method called getProfit that passes in the name of the item and three ItemSale objects. It will return the total profit for all items matching that itemName. Profit calculation is the same as the calculation in the previous method. Conditional Operators, Objects and Classes! O #com @ ItemSale saleld: int itemName: String purchasePrice: double sellPrice: double itemsSold: int .ItemSale(int, String, double double, int) getSaleld( : int getitemName(): String setItemName(String) : void getPurchasePrice() : double setPurchasePrice(double) : void getSellPrice(): double setSellPrice(double) : void getItems Sold(): int setitemsSold(int) : void com c. Item Demo main(String[]): void getMostExpensiveltem (Item Sale, ItemSale, ItemSale): String .getLargestProfitltem(Item Sale, ItemSale ItemSale): String getProfit(String, ItemSale, ItemSale, ItemSale) : double

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!