Question: Given main ( ) , define the Product class ( in file Product.java ) that will manage product member fields: a product code ( String

Given main(), define the Product class (in file Product.java) that will manage product member fields: a product code (String), the product's price (double), and the number Implement the following Constructor and member methods:
public Product(String code, double price, int count)- set the member fields using
public void setCode(String code)- set the product code (i.e. SKU234) to paramet
public String getCode()- return the product code
public void setPrice(double p)- set the price to parameter p
public double getPrice()- return the price
public void setCount(int num)- set the number of items in inventory to parameter
public int getCount()- return the count
public void addinventory(int amt)- increase inventory by parameter amt
public void selllnventory(int amt)- decrease inventory by parameter amt
Ex. If a new Product object is created with code set to "Apple", price set to 0.40, and theEx. If 10 apples are added to the Product object's inventory, but then 5 are sold, the output is
Given main ( ) , define the Product class ( in

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 Accounting Questions!