Question
please could you do this in Java ( Objected orinented programming) We want to program a product management application for a store. To do this,
please could you do this in Java ( Objected orinented programming)
We want to program a product management application for a store. To do this, we will write a Product class. Each product is characterized by:
name (String)
purchase price (double)
sale price (double)
the number of items in stock (int)
description (String).
Write the Product class with the following methods:
- Constructor allowing the creation of a product, we set its name, its purchase price and its selling price (i.e. these data are provided as arguments to the class constructor). By default, the product description is "No description", and the quantity of products in stock is null.
- Default constructor creating a product with null default values.
- Definition of the display() method to display the data of a product in the form of a String object.
- void modify(double price) which allows to modify the selling price of the product.
- Redefinition of the method equal(...) allowing to compare two products (two products are equal if they have the same name).
- The method increase (int quantite) allowing to increase the number of copies of the product in stock.
- The method decreaseint quantity) allowing to decrease the number of copies of the product in stock.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started