Question: JAVA OOP Name- Sid Id - 20 Category - books price- 100 Problem#2 Create an Inventory management system for UAP Bazar online store. For simplicity
JAVA OOP
Name- Sid
Id - 20
Category - books price- 100
Problem#2 Create an Inventory management system for UAP Bazar online store. For simplicity we will work with one product today. Each Product is identified by its name, id, category and price. The System should be able to keep track of the product, check the price, update the price and view the product info. What you need to do: 1) Create an Product class which has 4 instance variables; name, id, category and price. a. Create a constructor that takes initial value for those 4 attributes and initializes those attributes. Create the following 4 methods as described a. void updatePrice(double newPrice) Inside the method the price attributes need to be set to this newPrice. b. double getPrice() - The method returns the price. c. double getDiscounted Price(double discountPercentage) Store sometimes provide 10-30% discount on certain products. The method will return the price after discount d. void display() This method displays the attributes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
