Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In c + + A museum keeps a record of all its exhibited artworks. An art object may be a painting, a sculpture, or a
In c A museum keeps a record of all its exhibited artworks. An art object may be a painting,
a sculpture, or a statue.
Design an abstract class ArtWork that should have the following member variables:
totalnumber: This should be a static variable that keeps count of the total num
ber of artworks that are recorded.
serial: A serial number that should be automatically generated when an object of
a derived class is created.
artist: This stores the name of the artist.
year: This stores the year in which the art object was created.
The class ArtWork should have the following member functions:
A constructor that increments the member variable totalnumber and assigns the
serial number to the current value of totalnumber.
A mutator function.
An accessor function.
Derive a Painting class from the ArtWork class. It should have the following members:
type: This should denote the type of painting like oil, watercolor, etc.
drawnon: This should store the material on which the painting is drawn like can
vas, paper, wood, etc.
Derive a Sculpture class from the ArtWork class. It should have the following mem
bers:
height: This should store the height of the glass box required.
size: This should store the length of the glass box. The length and breadth of the
boxes are always the same.
material: This should store the material with which the sculpture is made like
stone, wood, wax, etc.
Derive a Statue class from the ArtWork class. It should have the following members:
diameter: This should store the diameter of the pedestal required.
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