Skip to content

How to use Polymorphism and protected data members in C++

Notifications You must be signed in to change notification settings

saif86/Protected-members-in-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Protected members in C++

How to use Polymorphism and protected data members in C++

Problem Statement

Create a Painting class that holds the painting title, artist name, and value. All Paintings are valued at $400 unless they are FamousPaintings. Include a display function that displays all fields. The FamousPainting subclass overrides the Painting value and sets each Painting’s value to $25,000.

Write a main( ) function that declares an array of 10 Painting objects. Prompt the user to enter the title and artist for each of the 10 Paintings. Consider the Painting to be a FamousPainting if the artist is one of the following: Degas, Monet, Picasso, or Rembrandt. Display the 10 Paintings.