Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Directions: Don't forget to add your Javadoc comments for your classes, constructor, and methods in this activity. For this assignment, you will need to create

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Directions: Don't forget to add your Javadoc comments for your classes, constructor, and methods in this activity. For this assignment, you will need to create a class called Inventoryltem that represents an inventory item in a store. Inventoryltem should have the following characteristics: InventoryItem Variables: o o o A String called name using the protected visibility modifier A double called price using the protected visibility modifier A private static double called taxRate (initialized to 0) . Constructor Sets the values for the instance variables name and price: public InventoryItem(String namein, double priceIn) o Methods: o public String getName () ( Returns the customer name o public double calculateCost) Returns the price including tax: price* (1 + taxRate) -Sets the tax rate - Return a String representation with name and price with tax o public static void setTaxRate (double taxRateIn)t o public String tostring) Example: "Computer: $789.02" return name + : + InventoryItem.setTaxRate (0.08) InventoryItem itemlnew InventoryItem ("Birdseed", 7.99) item1 Birdseed: $8.6292 1nventoryttem 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions