in C# language Design a Book class that holds the title, author’s name, and price of the book. Books’s constructor should initialize all of these data members except the price which is set to 500/-. Create a display method that displays all fields. All Books are priced at 500/- unless they are PopularBooks. The PopularBooks subclass replaces the Bookprice and sets each Book’s price to 50,000/- through PopularBooks construcor. Override the display method to display all fields. Write a Main () method that declares an array of five Book objects. Ask the user to enter the title and author for each of the 5 Books. Consider the Book to be a PopularBook if the author is one of the following: Khaled Hosseini, Oscar Wilde, or Rembrandt. Display the five Books’ details.
in C# language
Design a Book class that holds the title, author’s name, and price of the book. Books’s constructor should
initialize all of these data members except the price which is set to 500/-. Create a display method that
displays all fields.
All Books are priced at 500/- unless they are PopularBooks. The PopularBooks subclass replaces the
Bookprice and sets each Book’s price to 50,000/- through PopularBooks construcor. Override the display
method to display all fields.
Write a Main () method that declares an array of five Book objects. Ask the user to enter the title and
author for each of the 5 Books. Consider the Book to be a PopularBook if the author is one of the following:
Khaled Hosseini, Oscar Wilde, or Rembrandt. Display the five Books’ details.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images