Question: Retail store project contains information about the retail items including TAX, unitDescription, unitsOnHand and price. The TAX is a constant field. The unitDescription field references

Retail store project contains information about the retail items including TAX, unitDescription, unitsOnHand and price. The TAX is a constant field. The unitDescription field references a String object that holds a briefdescription of the item.The unitsOnHand field is an int variable that holds the number of unitscurrently in inventory.The price field is a double that holds the items retail price.This project will calculate the subtotal and the total payment according to the tax fees and discount rate if applicable. RetailItem -TAX:double -unitDescription: String -unitsOnHand: int - price: double + RetailItem(unitdes: String, numOfItem: int, cost : double): + getUnitDescription (): String + getUnitsOnHand ( ): int + getPrice(): double + getTAX( ): double +setUnitDescription(name: String):void + setUnitsOnHand (numOfItem: int):void + setPrice (cost: double): void + calculateTotal (numOfItem: int): double + calculateTotal (numOfItem: int, discount: double): double +toString ( ) : String Task #1 Create a project. Create the project in your Java NetBeans namedRetailStoreDemo Download the following filesRetailItem.java and RetailStoreDemo.javafrom the Blackboard. Create a new class called RetailItemand copythe code in RetailItem.java into your new RetailItemclass and compare it with the original one. Create a new class called RetailStoreDemoand copythe code in RetailStoreDemo.java into your new RetailStoreDemoclass and compare it with the original one. Task #2 Write the constructor 1. Write the constructor that Accepts the following values as arguments and assigns them to the appropriate fieldsunitDescription, unitOnHand, and price. 2. Set the TAXattributes to 0.15. Task #3 Write the required methods 1. calculateTotalmethod that calculates the total price by adding the tax amount to the subtotal priceaccording to the following equations: sub_total = itemNum * cost total = (sub_total * TAX) + sub_total 2. Overload thecalculateTotal methodthat takes a discount along with the number of items as a parameterto calculate the total price using thefollowing equations: sub_total = itemNum * cost total = (sub_total * TAX) + sub_total discount_amount=total*discount/100 total = total-discount_amount 3. toString method to print all the class fields. Task #4 Complete the main A. create an object from theRetailItemclass and send the following arguments that hold the following data: Unit description Unit on hands price Jacket 12 59.95 B. Write a call for calculateTotal method: You will call the appropriate calculateTotalmethodbased on whetherthe customer deserves the discount or not according to the following conditions: a) NO discount if the user purchases less than 3 items. Thus, you will need to call calculateTotal with one arguments which is the number of items. b) 10% discount if the user purchases more than 3 items. Thus, you will need to call calculateTotal that accept 10% discount as an argument along with the number of items. C. Write a call for toString method to display the result according to the below output. Task #5 Display the Output After calling all the method in Task #4, the output of this project should be as the following: display your name and Id number in the output

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!