in java create a class shopping mall. It has Items with name, manufacturer and price. Provide constructors. Getters, setters, toString methods. We add several items to Store. For that create a store class having name and array of items, Provide Constructors, getters/setters and toString(), in addition you have to provide a method add which add new item to the array.
in java create a class shopping mall. It has Items with name, manufacturer and price. Provide constructors. Getters, setters, toString methods.
We add several items to Store. For that create a store class having name and array of items, Provide Constructors, getters/setters and toString(), in addition you have to provide a method add which add new item to the array.
The main function that does these things looks as follows:
Public static void main(Strings[] args) {
Item shampoo2(“pantene”, “Procter & Gamble”,100), noodles(“Noodles”, “knorr”, 50);
// add further items.
Store abcSuperStore;
abcSuperStore.add(shampoo2);
abcSuperStore.add(noodles); …
abcSuperStore.sale(shampoo2); a
bcSuperStore.sale(noodles);
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images