Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a class Store which includes the attributes: store name, city. Write another class encapsulating an Art Gallery, which inherits from Store. An Art Gallery

Write a class Store which includes the attributes: store name, city. Write another class encapsulating an Art Gallery, which inherits from Store. An Art Gallery has the following additional attributes: how many paintings are sold every year and the number of artists submitting artwork.

Code the constructor, accessors, mutators, toString and equals method of the super class Store. Code the constructor, accessors and mutators for the subclass Art Gallery. In the Art Gallery class, also code a method returning the average number of paintings per artist for a year.

You should create a test class which creates 2 Art Gallery objects, then calls your set methods, get methods, toString and equals methods and the method to calculate the average paintings per artist for the Art Gallery objects.

please explain the equal methods too. I don't understand the equal method. how to write, why to write, and what does it do. thank you

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