Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Download: http://solutionzip.com/downloads/product-java-2/
- Create a class to encapsulate the data and behavior of a product in a store’s inventory. The class should have the following data for an inventory item:
- Product Number – String
- Description – String
- Quantity on hand – int
- Product Price – double
- Use appropriate access modifiers when defining the data
- Code accessor and mutator (get and set) methods for all class instance variables. Be sure to follow the class style and use _ as the name for the parameter corresponding to the class instance variable. (Note the “_” starting the parameter name.)
- If the product number or description is blank, or the values passed for the quantity or price are not valid, leave the associated instance variable unchanged.
- Create a class method to calculate and return the total amount for the product based on the quantity on hand and the product price.
- Use appropriate modifiers when creating the methods
- Download: http://solutionzip.com/downloads/product-java-2/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement