[solved]-Hello Really Stumped Go Question Anything Helps Thank Create Another Java Class Named Cust Q39002145
Hello, I am really stumped on how to go about this questionanything helps! Thank you!
Create another Java class named Customer
Part A.
Include the following Java classes in the same project,ProgrammingAssignment3.
Define all the instance variables with private accessmodifier. Declare constructors, and instance methods withpublic access modifier.
Item class: This class has the followinginstance variables, constructor, and instance methods.
Instance VariablesitemName: StringunitPrice: doublenumberOfUnits: intConstructorDefault constructorInstance methodsGetter and setter methods for itemName,unitPrice, and numberOfUnits variables.itemTotal: Finds the total price(unitPrice*numberOfUnits) for that particularitem and returns it.
Order class: This class has the followinginstance variables, static variable, constructor, instance andstatic methods.
Instance VariablesorderID: intcustomerName: Stringit1: Item class object initialized using the defaultconstructor.
it2: Item class object initialized using the defaultconstructor.
it3: Item class object initialized using the defaultconstructor.Static VariablenextOrderID: int variable initialized to 1000.Constructor
- Sets the value for orderID using thenextOrderID.
- Generates a random number between 1 to 10 (inclusive), sayp.
- Increases the nextOrderID by p.
Instance MethodsGetter and setter methods for orderID andcustomerName variables.
For each of the variables it1, it2, andit3 write:
- a getter method that returns the item, i.e., the return datatype is Item.
- a setter method that takes three input parametersname, unit price, and number of unitsforthe particular item and sets the object’s instance variables.
Note: There must be setter and getter methodsfor each three items separately.
displayOrderDetails: Displays the details of the orderin the format shown below this table. (Before the Part B.)
displayOrderTotal: Finds the total price for all threeitems in the cart and displays them. (Sum of the returned valuesfrom itemTotal method calls using it1,it2, and it3 objects.)Static MethoddisplayNextOrderNumber: Displays the value ofnextOrderID.
Format for displayOrderDetails result is asfollows:
Part B.
- Within the main method of the class Customercreate three objects of class Order, say, ord1,ord2, and ord3. Initialize the objects using thedefined constructor.
- Assign the following values to customer name and the threeitems in each of the Order objects.
ord1 Object:
customerNameHarry PotteritemNameunitPricenumberOfUnitsit1book3.55it2pen1.53it3ink7.51
ord2 Object:
customerNameHermione GrangeritemNameunitPricenumberOfUnitsit1book4.57it2ink7.51it3paper0.02500
ord3 Object:
customerNameRon WeasleyitemNameunitPricenumberOfUnitsit1wand15.751it2book3.53it3pencil1.54
For each of the orders ord1, ord2, andord3:
- Display the details of three items.
- Display the total price of all the items.
- Display a line of asterisks to separate each order.
- Display the order number of the next order.
Sample output of this program is as follows:
Expert Answer
Answer to Hello, I am really stumped on how to go about this question anything helps! Thank you! Create another Java class named C… . . .
OR

