Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 parameter, iterates through them, and displays the contents of DisplayReview Method in the console. All four reviews should display in the Console. It does not matter what order they are in.

8) End the program gracefully with a Console.ReadLine()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

Describe the importance of financing for entrepreneurial success.

Answered: 1 week ago

Question

Discuss the key ambient conditions and their effects on customers.

Answered: 1 week ago

Question

Understand the roles of signs, symbols, and artifacts.

Answered: 1 week ago