Question: In the Book class you created in Exercise 4a, overload the Object class Equals() method to consider two Books equal if they have the same
In the Book class you created in Exercise 4a, overload the Object class Equals() method to consider two Books equal if they have the same ISBN. Create a program that declares three Books; two should have the same ISBN and one should have a different one. Demonstrate that the Equals() method works correctly to compare the Books. Save the program as BookDemo2.
c. Write an application that declares two Book objects and uses an extension method named DisplayTitleAndAuthor() with each. The method displays a Books title, the word by, and the authors name. Save the program as BookDemo3.
question is based on C# .Net
4. a. Create an application named BookDemo that declares and demonstrates objects of the Book class and its descendents. The Book class includes auto- implemented properties for the International Standard Book Number (ISBN), title, author, and price. (An ISBN is a unique number assigned to each published book.) Create a child class named TextBook that includes a grade level and a CoffeeTableBook child class that contains no additional fields or properties. In the child classes, override the accessor that sets a Books price so that TextBooks must be priced between $20.00 and $80.00, inclusive, and CoffeeTableBooks must be priced between $35.00 and $100.00, inclusive. Be sure to use valid and invalid values when testing the child class properties.
question b follows question 4a
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
