[SOLVED] OOP Assignment 2 -Online Library System

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Online_Library_System-f41fnz.zip (1754.1 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

 

Task 1

Online library system

Using classes and arrays, the team will develop a set of functions for online library system. A system is represented by the following structure:

class UserList (7 marks)

{
private:

User* users; int capacity;
int usersCount;

public:
UserList(int capacity);
void addUser(User user); // at the end of the array.
User& searchUser(string name);
User& searchUser(int id);
void deleteUser(int id);
friend ostream &operator<<( ostream &output, UserList &userList )//to display all

books

~UserList(); };

class BookList (10 marks)

{
private:

Book* books; int capacity;
int booksCount;

public:
BookList(const BookList& anotherList); BookList(int capacity);
Book& searchBook(string name); Book& searchBook(int id);

1

Object-Oriented Programming Assignment 2

Cairo University, Faculty of Computers and Information

void deleteBook(int id); //delete a book
Book getTheHighestRatedBook();
Book* getBooksForUser(User); // get all books of this author
Book & operator [ ] (int position);
friend ostream &operator<<( ostream &output, BookList &booklist ); //to display all books ~BookList();

};

//Note: when you delete a book, the book could be in the middle of the array, which will leave a gap in your array of books. You should fill the gap by shifting all the books to the right of the deleted book one place to the left.
The same scenario should happen when deleting a user.

B1 id=1

B2 id=2

B3 B4 B5 deleteBook(2) id=3 id=4 id=5

B1 B3 B4 B5 id=1 id=3 id=4 id=5

2

Object-Oriented Programming Assignment 2 (20 Marks)

General Notes:

Cairo University, Faculty of Computers and Information

  1. 1-  Please make sure to adhere to the provided classes’ interfaces.
  2. 2-  Youcanaddanyrequiredfunctionstohelpyoutogettheoutputs.
  3. 3-  Submissionwillinclude4classesandtheirimplementation(Book,User,

    BookList, UserList) and a main function that provides the same experience as the screenshots provided.

Task 2 (3 Marks)

  • –  Team should write a demo program to demonstrate the use of these functions.
  • –  Team should test the entire program and make sure that it works correctly in full.
  • –  All team members must fully understand all parts of the program.

    Task 3 – Writing Good Quality Code

    No program stays the same. It will need to change to fix bugs, add new features, etc. So, it is very important to write high quality readable code, so that you or other developers can be able to review and modify this code in the future. In this task, you will:

    1- Add a header to your program saying who the author is, the purpose of the program, etc.
    2- Add a header for every function explaining what it does, what parameters it takes and what value it returns.
    3- Write the code following C++ coding style. http://geosoft.no/development/cppstyle.html
    4- Add comments to any part that is difficult to understand.

    Note: if you didn’t do it you will lose 1 mark.

    Grading criteria (Total 20 marks)

    Task 1 [17 marks]
    – User class (7 marks)
    – Parameterized constructor (1 mark) – add user (1 mark)
    – two searching methods (2 mark)
    – delete user (1 mark)
    – Operator << (1 mark)

3

Object-Oriented Programming Assignment 2

-destructor(1 mark)
– Book class (10 mark)
– Parameterized constructor (1 mark)
– Copy constructor (1 mark)
– two searching methods (2 mark)
– delete book (1 mark)
– Operator << and operator [] (2 mark)
– highest Rate book function (1 mark)
-get book for user (1 mark)
-destructor (1 mark)
– Task 2 – General Checks and Main [3 mark] – Creating userlist object in the main (1 mark)
– Creating booklist object in the main (1 mark) – Follow the classes’ interfaces (1 mark)

Submission Instructions

Cairo University, Faculty of Computers and Information

1- Only 1 member of the team will submit into Blackboard a zip file. Carefully follow the mentioned steps to create your zip file: a. Go to the folder of your project and create a new text file (names.cpp) with the names and IDs of the team. b. Delete the exe file of the project found in the bin directory c. Zip the whole folder of the project and name it in the following form ID1_ID2, where ID1 is id of the first student and ID2 is the id of the second student. Ex. (20192222_20198888)

2- All team members must understand the details of the entire program and be able to explain it or even modify it if needed.

3- TA can ask any team member about any of the programs developed and its code.

By failing to follow the submission instructions of the assignment, you are risking your assignment’s grade.

4

Object-Oriented Programming Assignment 2

A Sample Run

Cairo University, Faculty of Computers and Information

5

Object-Oriented Programming Assignment 2 (20 Marks)

Cairo University, Faculty of Computers and Information

6

Object-Oriented Programming Assignment 2 (20 Marks)

Cairo University, Faculty of Computers and Information

7

Object-Oriented Programming Assignment 2 (20 Marks)

Cairo University, Faculty of Computers and Information

8

Object-Oriented Programming Assignment 2 (20 Marks)

Cairo University, Faculty of Computers and Information

9

Object-Oriented Programming Assignment 2 (20 Marks)

Cairo University, Faculty of Computers and Information

10

Object-Oriented Programming Assignment 2 (20 Marks)

Cairo University, Faculty of Computers and Information

11

Object-Oriented Programming Assignment 2 (20 Marks)

Cairo University, Faculty of Computers and Information

12

Object-Oriented Programming Assignment 2 (20 Marks)

Cairo University, Faculty of Computers and Information

13

  • Online_Library_System-f41fnz.zip