Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

equation using the x-int ercep 4y-5x=20

Answered: 1 week ago