Question

You must write C# classes which are used to manage product review data for Books and...

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<IReviewDisplayer>

7) Create a method that accepts the List<IReviewDisplayer> 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()

0 0
Add a comment Improve this question Transcribed image text
Answer #1

yo4uMt 酉pte an absroa 다 С.lass called Review c.,hKh abshaels Common Popeshes .you u:Ulthen ctoate anInt e ช face Yesponsebe fratng value else 11 se. default rol,y tos selusn Comment Set (value length ) Iset the de fault com ment value to blank Commenname Space psooci Revie class Book Reveu; ReVtew,RevoewD%;player le vale a comments+ Cemmeol Pubic sting pealeshipSe+ dealesship value pubifc stang Disploy Revieu () mmerr using Sotem System, collect OnS, UKneaic, name space Pooduct Revieueview oealeship console Read Line console eet youz feed back ) reve2. Ri parse (console Read inelm eviau 2. peleavshp conso/x dSs Play InfosmalPon on console D?s playe6 in.TevYew pSs play e.cs) ev.ew ธ evo ew End Hh 6m 9atefull console. Reed iine

Add a comment
Know the answer?
Add Answer to:
You must write C# classes which are used to manage product review data for Books and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program in C++ with comments! Create an abstract class Property, containing the data items...

    Write a program in C++ with comments! Create an abstract class Property, containing the data items owner, address and price. Add an abstract method showOwner(). Also provide getter/setters for all the data items. Make validations if necessary in the setter so that no invalid values are entered. Create a class House, to inherit the Property class. This class should contain additional data item – yardSize – an integer – the size of the yard of the house, getter and setter...

  • ********************Java Assigment******************************* 1. The following interface and classes have to do with the storage of information...

    ********************Java Assigment******************************* 1. The following interface and classes have to do with the storage of information that may appear on a mailing label. Design and implement each of the described classes below. public interface AddrLabelInterface { String getAttnName(); String getTitle(); // Mr., Mrs., etc. String getName(); String getNameSuffix(); // e.g., Jr., III String getProfessionalSuffix(); // O.D. (doctor of optometry) String getStreet(); String getSuiteNum(); String getCity(); String getState(); String getZipCode(); } Step 1 Create an abstract AddrLabel class that implements the...

  • About Classes and OOP in C++ Part 1 Task 1: Create a class called Person, which...

    About Classes and OOP in C++ Part 1 Task 1: Create a class called Person, which has private data members for name, age, gender, and height. You MUST use this pointer when any of the member functions are using the member variables. Implement a constructor that initializes the strings with an empty string, characters with a null character and the numbers with zero. Create getters and setters for each member variable. Ensure that you identify correctly which member functions should...

  • Implement the classes in the following class diagram. The Book class implements the Comparable interface. Use impl...

    Implement the classes in the following class diagram. The Book class implements the Comparable interface. Use implements Comparable<Book> in the class definition. Now, all book objects are instances of the java.lang.Comparable interface. Write a test program that creates an array of ten books. 1. Use Arrays.sort( Book[]l books) from the java.util package to sort the array. The order of objects in the array is determined using compareTo...) method. 2. Write a method that returns the most expensive book in the...

  • JAVA :The following are descriptions of classes that you will create. Think of these as service...

    JAVA :The following are descriptions of classes that you will create. Think of these as service providers. They provide a service to who ever want to use them. You will also write a TestClass with a main() method that fully exercises the classes that you create. To exercise a class, make some instances of the class, and call the methods of the class using these objects. Paste in the output from the test program that demonstrates your classes’ functionality. Testing...

  • A Java Program Purpose:         Work with Abstract classes. Purpose:         Abstract classes are import because they ensure...

    A Java Program Purpose:         Work with Abstract classes. Purpose:         Abstract classes are import because they ensure than any children which inherit from it must implement certain methods. This is done to enforce consistency across many different classes. Problem:        Implement a class called Student. This class needs to be abstract and should contain a String for the name, and a String for the major (and they should be private). The class must have a constructor to set the name and major....

  • Write the following in Java Design a class called ReviewSystem, this class should have an attribute...

    Write the following in Java Design a class called ReviewSystem, this class should have an attribute reviewList, which is an ArrayList type. add a constructor to initialize the attribute. add a method addReviewAndComment(). This method asks from the user to provide an integer (0 to 4 for the five ratings) and a String as a comment. If the user inputs -1, it ends the loop of asking. All valid user inputs should be saved to the reviewList attribute. For example:...

  • 3. Suppose the University has two types of academics: students and lecturers. Both of these have...

    3. Suppose the University has two types of academics: students and lecturers. Both of these have names and ids, but students attend lectures while lecturers give them. class Student private: string name; string id; public: Student (string name, string id); string getName ); string getIDO; void attendLecture(); class Lecturer private: string name; string id; public: Lecturer(string name, string id); string getName; string getIDO; void giveLecture (); a) Write the header for a class called Academic and update the Student and...

  • Requirements:  Your Java class names must follow the names specified above. Note that they are...

    Requirements:  Your Java class names must follow the names specified above. Note that they are case sensitive. See our template below.  BankAccount: an abstract class.  SavingAccount: a concrete class that extends BankAccount. o The constructor takes client's firstname, lastname and social security number. o The constructor should generate a random 6-digit number as the user account number. o The initial balance is 0 and the annual interest rate is fixed at 1.0% (0.01).o The withdraw method signature...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT