Ask Computer Engineering Expert

Objectives

For this programming project, you will develop a library management program that maintains the library book list and the library client (i.e., customer) list, as well as the interactions between the two lists. The program allows the librarian to add copies of books, add clients, let a client check out (i.e., borrow) books, and let a client check in (i.e., return) books.

Problem Description

In this programming assignment, you will develop a project that implements an engineering library (or any other library; engineering library is mentioned because all the books I currently include are engineering textbooks). You will implement and test four classes in this assignment. They are the BookType, BookRecord, ClientType, and LibraryType classes. You are to write the four implementation files: BookType.cpp, BookRecord.cpp, ClientType.cpp, and LibraryType.cpp. In the following, we will discuss each class in more detail.

The BookType Class

Each object of the BookType class contains the related information of a book. The BookType.h file is given to you. Carefully read the class definition in BookType.h. The BookType class has five protected data members. They are: a string ISBN13 to store the 13-digit ISBN of a book; a string primaryAuthor to store the primary author's last name; a string title to store the book title; a string publisher to store the publisher's name; and an integer key to indicate the key member used for searching and sorting.

You are to implement and test the following operations for the BookType class. Detailed description and precondition/postcondition for all the BookType's member functions are specified in the given header file.

• A constructor.
• Five set functions: setISBN13, setPrimaryAuthor, setTitle, setPublisher, setKey.
• A setBookInfo function.
• Five get functions: getISBN13, getPrimaryAuthor, getTitle, getPublisher, getKey.
• The six comparison operators.
• The operator << (as a friend function).

The BookType class objects are used to represent books borrowed by a client (this will be discussed in the ClientType class).

The BookRecord Class

The BookRecord class is a subclass inherited from the BookType class. The BookRecord.h file is given to you. Carefully read the class definition in BookRecord.h. In addition to the protected data members of the BookType class, the BookRecord class has two additional protected data members: an integer copiesTotal to store the total number of copies of a book in the library (note that a library book may have multiple copies); an integer copiesAvailable to store the available (i.e., unchecked-out) number of copies of a book in the library.

You are to implement and test the following operations for the BookRecord class. Detailed description and precondition/postcondition for all the BookRecord's member functions are specified in the given header file.

• A constructor.
• Two set functions: setCopiesTotal, setCopiesAvailable.
• A setBookRecord function.
• Two get functions: getCopiesTotal, getCopiesAvailable.
• The operator << (as a friend function).

The BookRecord class objects are used to represent books possessed by the library (this will be discussed in the LibraryType class).

The ClientType Class

Each object of the ClientType class contains the related information of a library client. The ClientType.h file is given to you. Carefully read the class definition in ClientType.h. The ClientType class has five protected data members. They are: a string ID7 to store the 7-digit ID number of a client; a string lastName to store the client's last name; a string firstName to store the client's first name; an integer key to indicate the key member used for searching and sorting clients; a sorted linked list bookList of BookType objects to store the books borrowed by the client.

You are to implement and test the following operations for the ClientType class. Detailed description and precondition/postcondition for all the ClientType's member functions are specified in the given header file.

• A constructor.
• Five set functions: setID7, setLastName, setFirstName, setKey, setBookList.
• A setClientInfo function.
• Five get functions: getID7, getLastName, getFirstName, getKey, getBookList.
• A borrowBook function.
• A returnBook function.
• The six comparison operators.
• The assignment operator=.
• The operator << (as a friend function).

The ClientType class objects are used to represent clients of the library (this will be discussed in the LibraryType class).

The LibraryType Class

Each object of the LibraryType class contains the related information of a library. The LibraryType.h file is given to you. Carefully read the class definition in LibraryType.h. The LibraryType class has two protected data members: a sorted linked list bookRecordList of BookRecord objects to store the books possessed by the library; a sorted linked list clientList of ClientType objects to store the clients of the library.

You are to implement and test the following operations for the LibraryType class. Detailed description and precondition/postcondition for all the LibraryType's member functions are specified in the given header file.

• A default constructor.
• A parameterized constructor.
• Two set functions: setBookRecordList, setClientList.
• Two get functions: getBookRecordList, getClientList.
• An addBook function.
• An addClient function.
• A getBookRecord function.
• A getClient function.
• A borrowBook function.
• A returnBook function.

The LibraryType class is used to generate an engLib object which represents the School of Engineering Library.

Additional Requirements and Hints

The Header Files

Besides the aforementioned four header files, you are also to use the following header files in this project: NodeType.h, LinkedListIterator.h, LinkedListType.h, SortedLinkedList.h. You have been supplied all eight header files in the proj2header.zip file (available on Blackboard).

Note that the LinkedListType.h is slightly different from the LinkedListType.h we discussed in lectures. Here we have made the destructor a virtual function, and also added a template version of operator<<. For SortedLinkedList.h, here we have added a default and a copy constructors and a destructor.

Preconditions

For this assignment, you only need to check the precondition for the setBookRecord function of the BookRecord class. For all other functions, you may simply assume that the preconditions are satisfied.

Existing Book and Client Information

The existing books and clients are given in the files books.txt and clients.txt (available on Blackboard). They are loaded to initialize the two protected members of engLib at the beginning of the EngLibTest.cpp file (available on Blackboard).

Implement and Test Small Pieces

Don't tackle to whole project at once. Start by implementing what you can, using one or several member functions together with a simple test driver client program to test the functionality of the functions.

Test the Completed Programs

After you have tested your programs using your own test driver code, you may test your programs using the given testing program EngLibTest.cpp (available on Blackboard).

What to Turn in

Make sure you name the .cpp files as BookType.cpp, BookRecord.cpp, ClientType.cpp, and LibraryType.cpp. Then zip these four files (if you have modified any other files, include them too) and save it as your_lastname_project2.zip

Attachment:- Help.zip

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91924136

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As