Question: You will write a C# program for a small bookstore that deals in both printed books and audiobooks. You will create a base class called

You will write a C# program for a small bookstore that deals in both printed books and audiobooks.
You will create a base class called Book with the following members:
ISBN (String type Property): auto-implemented getter and setter.
Price (Double type Property): define getter and setter. The setter will check the validity of
the value that must be less than $200 before setting. If it is more than $200, it will be set to
$200.
Title (String type Property): auto-implemented getter and setter.
Author (String type Property): auto-implemented getter and setter.
SalePrice (Double type Property): No setter. The getter will add 15% profit to the Price and
return this value.
ShowInfo (void type public method): This will print the ISBN, title, author, and the sale
price.
The Book class will be extended to create an Audiobook child class. This will have additional public
Properties called Length (in hours, integer type) and Narrator (string type). These will store the
length of the audiobook and the name of the person who narrated the book, respectively. Both
properties will have auto-implemented getter and setter.
The Audiobook class will override the following members of the parent class:
Price: define getter and setter. The setter will check the validity of the value that must be
less than $100 before setting. If it is more than $100, it will be set to $100.
SalePrice (Double type Property): No setter. The getter will add 20% profit to the Price and
return this value.
ShowInfo (void type public method): This will print the ISBN, title, author, length, narrator,
and the sale price.
Feel free to define any additional private backing fields as required in both classes.
You will write a static class called BookstoreInventory that will contain the Main method. The main
method will create two arrays of objects: books and audiobooks. The lengths of the arrays will be
200 and 50, respectively. The user will be given 4 options to choose in a loop: add a book, add an
audiobook, show inventory, and quit. You can use any letters or numbers for these options. Adding
a book will ask the user to input ISBN, Price, Title, and Author of the book object. Adding an
audiobook will ask for additional values for the length and narrator. The show inventory option
will ask for the type and title or author of the book. Based on user input, it will search the
appropriate array (book or audiobook). When a match for the title or author is found, it will call
the ShowInfo method of the object. Keep in mind that there could be more than one match for the
title or author, and your program will show info for all of them. You should use additional variables
to keep track of the number of books and audiobooks added to the inventory. You should also
check for the limit of the size of the arrays.
Important: Do NOT use any C# language-features (or data input methods) that has not been
taught in the class. Check the lecture slides to verify this. Some concepts may exist in the
textbook, but we did not learn those in the class. You are NOT allowed to use these. Submissions
that utilize any C# language-features beyond the lecture slides will automatically receive 0 in
the assignment.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!