Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed 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

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

Students also viewed these Databases questions