Question: Directions: Don't forget to add your Java oc comments for your classes, constructor and meth ods in this activity. For this assignment, you will need

 Directions: Don't forget to add your Java oc comments for your
classes, constructor and meth ods in this activity. For this assignment, you
will need to create a class called Inventoryltem that represents an inventory
item in a store. InventoryItem should have the following characteristics: Inventoryltem Variables:
o A String called name using the protected visibility modifier o A
double called price using the protected visibility modifier o A private static
double called taxRate (initialized to 0) . Constructor o Sets the values

Directions: Don't forget to add your Java oc comments for your classes, constructor and meth ods in this activity. For this assignment, you will need to create a class called Inventoryltem that represents an inventory item in a store. InventoryItem should have the following characteristics: Inventoryltem Variables: o A String called name using the protected visibility modifier o A double called price using the protected visibility modifier o A private static double called taxRate (initialized to 0) . Constructor o Sets the values for the instance variables name and price: public Inventoryitem (String nameIn, double priceIn) o public string getName) f o public double calculateCost) f o public static void setTaxRate (double taxRateIn) f Methods: - Returns the customer name - Returns the price including tax: price *(1+ taxRate - Sets the tax rate . Return a String representation with name and price with tax o public String toString) Example: "Computer: $789.02" return name+"+ InventoryItem.setTaxRate (0.08)i InventoryItem item1 - new InventoryItem ("Birdseed", 7.99): Birdseed: $8.6292 iteml InventoryItem item2 new InventoryItem ("Picture", 10.99): item2 Picture: $11.869200000000001 Be sure to unfold these objects on the workbench to verify the field values

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!