COS2614 Assignment 3 - Library Management System
If Need help 0793226427 downloading .zip File or with
anything please. Follow the link to access the .zip file
or reach me for easier access
https://drive.google.com/file/d/1XMn9BWb6V2swF_ia4
eyXYaacz9crkYA_/view?usp=drive_link
Google drive
Or
One drive
COS2614_Assignment3_LibrarySystem.zip
This document provides a summary and steps of the COS2614 Assignment 3 Qt-based
Library Management
System project.
Features Implemented:
- Object-oriented class design with inheritance and polymorphism
- Template-based generic storage container
- GUI using Qt Widgets (QMainWindow, QListWidget, QLineEdits, QPushButtons)
- Functionality to add Books and Magazines
- Search feature by title
- File structure prepared for file persistence (QFile and QTextStream)
- Custom utility library created for reusability
Setup Instructions:
1. Open the project in Qt Creator.
2. Build the project using C++17 or later.
, 3. Run the application to interact with the system.
User Interface Overview:
- Input fields allow you to enter title, author, ID, genre (for books), and issue number (for
magazines).
- Buttons to add Book or Magazine, and to search for existing items.
- List widget to show search results and item list.
This project is designed to be modular, maintainable, and demonstrates a clear
application of core
concepts in C++ and Qt.
#ifndef LIBRARYITEM_H #define LIBRARYITEM_H #include <QString> class
LibraryItem { protected: QString title; QString author; int id; public:
LibraryItem(const QString& title, const QString& author, int id); virtual
~LibraryItem() {} QString getTitle() const; QString getAuthor() const; int
getId() const; void setTitle(const QString& title); void setAuthor(const
QString& author); void setId(int id); virtual QString displayInfo() const =
0; }; #endif
🔹 2. Book.h and Book.cpp
Book.h
cpp
CopyEdit
#ifndef BOOK_H #define BOOK_H #include "LibraryItem.h" class Book : public
LibraryItem { private: QString genre; public: Book(const QString& title,
const QString& author, int id, const QString& genre); QString getGenre()
const; void setGenre(const QString& genre); QString displayInfo() const
override; }; #endif
Book.cpp
cpp
CopyEdit
#include "Book.h" Book::Book(const QString& title, const QString& author, int
id, const QString& genre) : LibraryItem(title, author, id), genre(genre) {}
QString Book::getGenre() const { return genre; } void Book::setGenre(const
QString& genre) { this->genre = genre; } QString Book::displayInfo() const {
return QString("Book: %1 by %2 [ID: %3, Genre: %4]")
.arg(title).arg(author).arg(id).arg(genre); }
If Need help 0793226427 downloading .zip File or with
anything please. Follow the link to access the .zip file
or reach me for easier access
https://drive.google.com/file/d/1XMn9BWb6V2swF_ia4
eyXYaacz9crkYA_/view?usp=drive_link
Google drive
Or
One drive
COS2614_Assignment3_LibrarySystem.zip
This document provides a summary and steps of the COS2614 Assignment 3 Qt-based
Library Management
System project.
Features Implemented:
- Object-oriented class design with inheritance and polymorphism
- Template-based generic storage container
- GUI using Qt Widgets (QMainWindow, QListWidget, QLineEdits, QPushButtons)
- Functionality to add Books and Magazines
- Search feature by title
- File structure prepared for file persistence (QFile and QTextStream)
- Custom utility library created for reusability
Setup Instructions:
1. Open the project in Qt Creator.
2. Build the project using C++17 or later.
, 3. Run the application to interact with the system.
User Interface Overview:
- Input fields allow you to enter title, author, ID, genre (for books), and issue number (for
magazines).
- Buttons to add Book or Magazine, and to search for existing items.
- List widget to show search results and item list.
This project is designed to be modular, maintainable, and demonstrates a clear
application of core
concepts in C++ and Qt.
#ifndef LIBRARYITEM_H #define LIBRARYITEM_H #include <QString> class
LibraryItem { protected: QString title; QString author; int id; public:
LibraryItem(const QString& title, const QString& author, int id); virtual
~LibraryItem() {} QString getTitle() const; QString getAuthor() const; int
getId() const; void setTitle(const QString& title); void setAuthor(const
QString& author); void setId(int id); virtual QString displayInfo() const =
0; }; #endif
🔹 2. Book.h and Book.cpp
Book.h
cpp
CopyEdit
#ifndef BOOK_H #define BOOK_H #include "LibraryItem.h" class Book : public
LibraryItem { private: QString genre; public: Book(const QString& title,
const QString& author, int id, const QString& genre); QString getGenre()
const; void setGenre(const QString& genre); QString displayInfo() const
override; }; #endif
Book.cpp
cpp
CopyEdit
#include "Book.h" Book::Book(const QString& title, const QString& author, int
id, const QString& genre) : LibraryItem(title, author, id), genre(genre) {}
QString Book::getGenre() const { return genre; } void Book::setGenre(const
QString& genre) { this->genre = genre; } QString Book::displayInfo() const {
return QString("Book: %1 by %2 [ID: %3, Genre: %4]")
.arg(title).arg(author).arg(id).arg(genre); }