Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . Give concise answers to the following questions / 1 0 a ) What is the importance of using properties in a C# program?

1. Give concise answers to the following questions /10
a) What is the importance of using properties in a C# program?
/4
b) When do local objects occupy memory (Compile-time or run time)? Explain.
/3+3
2. Design a class representing a superstore item. You dont need to write implementations for any member functions, just list any public or private field, property, or method declarations you think; may be needed.
/10
Assignment 1: Bookstore
Overview
Write a program that manages a simple Book Store by utilizing the Object-Oriented Programming Architecture.
Directions
A bookstore wants to develop a system to add/remove readers, add/remove books, track books rented and returned from registered readers, and show bookstore information. To endure books rented and returned, your program will need to track books and readers. A reader can rent a maximum of 2(two) books, and he/she can rent a book if it is available at the store and not rented by other readers. The store can remove any book if the book is not already rented to someone. The store can also remove a reader, however, to remove a reader, all books rented by him/her must be returned otherwise, the system will generate an error message.
Your program must track each book and every reader. The implementation of your bookstore program can be done by the following steps:
1. Create a Book class (Fully implemented in the starter code.)
a. Add fields for the books name, serial, and status. (Assume, the bookstore has the same book of multiple copies. i.e., book names can be the same, however, will always differ by the serial number. i.e., together book name and serial will be unique!)
b. Add a constructor that initializes every books field with given values.
c. Add a function to check the availability of a book.
d. Add a function to rent a book.
e. Add a function to return a book.
f. Finally, add a function to show book information.
2. Create a Reader class (Some methods are implemented in the starter code.)
a. Add fields for the readers name and a list of books. (Assume each readers name is unique. i.e., there are no two readers in the bookstore with the same name.)
b. Add a constructor that initializes the readers name and creates an empty list of books.
c. Add a function to rent a book and add the book to the readers list.
d. Add a function to return a book and remove the book from the list.
e. Finally, add a function to show the reader information.
3. Create a Bookstore class. (Some methods are implemented in the starter code.)
a. Add fields in order to store the list of books and the list of readers for the bookstore.
b. Add a constructor to initialize all lists to an empty list.
c. Add a method for adding a reader to the store.
d. Add a method for removing a reader from the store. (To remove a reader, all books rented by him/her must be returned first!)
e. Add a method for adding a book to the store.
f. Add a method to remove a book from the store. (To remove a book, it should be available in the store, otherwise, the program should issue an error message!)
g. Add a method to rent a book for a reader.
h. Add a method to return a book from a reader.
i. Add a method to show bookstores all books information
j. Finally, add a method to show bookstores all readers information.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

=+(0

Answered: 1 week ago