Assignment 2-OOP-Screenshots
Assignment 2-OOP-Screenshots
Instructions
1- Students will be the same groups of assignment 1.
2- Deadline of submission is Dec 23rd at 11:55 pm.
3- Please submit only work that you did yourself. If you copy work from your friend or
book or the internet, you will lose the marks of this assignment.
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();
};
};
//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 B2 B3 B4 B5 deleteBook(2)
id=1 id=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) Cairo University, Faculty of
Computers and Information
General Notes:
1- Please make sure to adhere to the provided classes’ interfaces.
2- You can add any required functions to help you to get the outputs.
3- Submission will include 4 classes and their implementation (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.
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.
Submission Instructions
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 (20 Marks) Cairo University, Faculty of
Computers and Information
A Sample Run
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