Question
You must write C# classes which are used to manage product review data for Books and Cars. You will write an abstract class called Review
You must write C# classes which are used to manage product review data for Books and Cars. You will write an abstract class called Review which abstracts common properties (review rating and comments). You will then create an Interface responsible for the functionality to display the Reviewcontent. Then, you will create 2 concrete classes which inherit from Review and implement the Interface. Finally, you will create console applicationwhich will create 2 CarReview instances and 2 BookReview instances and display them in the console.
1) Implement an abstract C# base class called Review with private members and public properties which accept a rating number (1 through 5 only, type int) and comments (type string, maximum of 200 characters only). Your class should have public setters/getters. Your setters should enforce the constraints on values for rating and comments.
2) Implement two concrete classes which inherit from this base class named CarReview and BookReview. CarReview should have a unique private string field and public string property called Dealership. BookReview should have a unique private field/public property called Title. Do not put Dealership in BookReview, and do not put Title in CarReview. These should be unique in each concrete class.
3) Create a public interface called IReviewDisplayer and define a method called DisplayReview() which returns type string.
4) Implement the IReviewDisplayer interface in CarReview and BookReview.
In CarReview, return the formatted string in DisplayReview implementation: Rating:
{0} Dealership: {1} Comments: {2}
In BookReview, return the the formatted string in DisplayReview implementation:
Rating: {0} Title: {1} Comments: {3}
5) Create a C# console application that uses the console and input from the user to create 2 Car Reviews and 2 Book Reviews.
6) Add all four of these reviews to a single List type. Hint: this is going to be List
7) Create a method that accepts the List
8) End the program gracefully with a Console.ReadLine()
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