0% found this document useful (0 votes)
35 views2 pages

OOP Assignment2 15apr Hina

The document outlines an assignment to implement a library management system using C++. It describes tasks to complete the implementation using procedural programming, object-oriented programming, and file handling. It provides instructions for implementation focusing on data validation, member functions, constructors, copying objects, arrays, pointers, and memory management.

Uploaded by

Arishba Aftab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views2 pages

OOP Assignment2 15apr Hina

The document outlines an assignment to implement a library management system using C++. It describes tasks to complete the implementation using procedural programming, object-oriented programming, and file handling. It provides instructions for implementation focusing on data validation, member functions, constructors, copying objects, arrays, pointers, and memory management.

Uploaded by

Arishba Aftab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Capital University of Science and Technology

Department of Software Engineering


OOP # SE1143-241-BSE-233-3
Assignment # 2
Semester: Spring 2024 Max Marks:10
Due Date: April 23th , 2024

Instructor: Hina Rashid


Submission Instructions:
• Files to be submitted: RegNo._Name_Assignment02.cpp and RegNo._Name_Assignment02.docx
• Ensure error-free code and include output screenshots.
• Plagiarism will result in a zero mark.
• After submission, a demonstration will be conducted

Library Management System Implementation


Consider a C++ class termed as Book for managing books in a library with the following data
members:
• BookID // Unique identifier for each book
• Title // Title of the book
• Author // Author of the book
• Genre // Genre of the book
• Quantity // Number of copies available in the library
Data Validation:
• BookID should be a positive integer and unique for each book.
• Title and Author should not exceed a certain length (e.g., 50 characters).
• Genre should be chosen from a predefined list of genres.
• Quantity should be a positive integer.
Functions:
• Method to display book details.
• Method to borrow a book (decrease quantity).
• Method to return a book (increase quantity).
Task 1: Implementation using Procedural Programming
• Flexibility allowed to adjust specifications for achieving the desired result.
Task 2: Implementation using Object-Oriented Programming
• Define a Library class to manage a collection of Book objects.
• Implement data validation checks in constructors and setter functions.
• Develop methods to add, remove, and search books in the library.
• Implement borrowing and returning functionality.
Task 3: Implementation using Object-Oriented Programming with File Handling
• Extend the implementation to save and load library data from files.
• Use static arrays for managing books.
Task 4: Object-Oriented vs Procedural Programming
• Elaborate understanding of OOP vs PP.
• Highlight differences identified during implementation of the given scenario.
• Response limited to one page.

Submission Guidelines:
• Present findings and understanding in a report format.
• Use code snippets and output snippets to demonstrate understanding.
• Provide explanations with supporting figures and results.
• Use a table of contents, captions, and figure numbers.
• Provide complete code at the end of the report.

Instructions for Implementation:


1. Implement complex data validations: (2 marks)
• Ensure robust validation checks for BookID, Title, Author, Genre, and Quantity.
2. Include member functions: (2 marks)
• Implement functions for displaying book details, borrowing, and returning books with
proper error handling.
3. Utilize constructors: (1 mark)
• Implement constructors, including parameterized constructors, for object initialization.
4. Incorporate copy constructors: (1 mark)
• Include copy constructors for handling object copying scenarios.
5. Utilize arrays of objects: (1 mark)
• Implement arrays of Book objects for efficient management.
6. Implement shallow or deep copy: (1 mark)
• Utilize appropriate copy concepts, either shallow or deep, as needed.
7. Use of pointers: (1 mark)
• Employ pointers for dynamic memory allocation and proper memory management.
8. Static and dynamic array usage: (1 mark)
• Utilize both static arrays and dynamic arrays considering memory and performance
requirements.
Notes:
• Use clear and descriptive variable names.
• Test code thoroughly to ensure it meets specifications.
• Maintain clarity and coherence in the report.
• Debug any encountered errors promptly.
• Review report for grammatical and typographical errors before submission.

You might also like