Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "C:/msys64/ucrt64/bin/gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/DMortal/OOP_Project_Muhammad_Awwal/Project/ProjectCpp",
"program": "c:/Users/DMortal/OOP_Project_Muhammad_Awwal/Project/ProjectCpp/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
59 changes: 59 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
18 changes: 18 additions & 0 deletions Project/ProjectCpp/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "C:/msys64/ucrt64/bin/gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}
24 changes: 24 additions & 0 deletions Project/ProjectCpp/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/DMortal/ProjectCpp",
"program": "c:/Users/DMortal/ProjectCpp/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
59 changes: 59 additions & 0 deletions Project/ProjectCpp/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
30 changes: 30 additions & 0 deletions Project/ProjectCpp/Patron.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Source: patron.cpp
#include "patron.h"

// Constructor implementation
Patron::Patron(const std::string& name, const std::string& libraryCardNumber)
: name(name), libraryCardNumber(libraryCardNumber) {}

// Getter for the patron's name
std::string Patron::getName() const { return name; }

// Getter for the library card number
std::string Patron::getLibraryCardNumber() const { return libraryCardNumber; }

// Setter for the patron's name
void Patron::setName(const std::string& name) { this->name = name; }

// Setter for the library card number
void Patron::setLibraryCardNumber(const std::string& libraryCardNumber) {
this->libraryCardNumber = libraryCardNumber;
}

// Placeholder for updating contact information
void Patron::updateContactInfo(const std::string& newContactInfo) {
// Logic for updating contact information can be added here
}

// Checks if the patron can borrow more books
bool Patron::canBorrowMoreBooks(int currentBorrowedCount, int maxLimit) const {
return currentBorrowedCount < maxLimit;
}
Binary file added Project/ProjectCpp/a.exe
Binary file not shown.
24 changes: 24 additions & 0 deletions Project/ProjectCpp/book.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Source: book.cpp
#include "book.h"

// Constructor implementation
Book::Book(const std::string& title, const std::string& author, const std::string& isbn)
: title(title), author(author), isbn(isbn) {}

// Getter for the book title
std::string Book::getTitle() const { return title; }

// Getter for the author's name
std::string Book::getAuthor() const { return author; }

// Getter for the ISBN
std::string Book::getISBN() const { return isbn; }

// Setter for the book title
void Book::setTitle(const std::string& title) { this->title = title; }

// Setter for the author's name
void Book::setAuthor(const std::string& author) { this->author = author; }

// Setter for the ISBN
void Book::setISBN(const std::string& isbn) { this->isbn = isbn; }
28 changes: 28 additions & 0 deletions Project/ProjectCpp/book.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Header: book.h
#ifndef BOOK_H
#define BOOK_H

#include <string>

class Book {
private:
std::string title; // Stores the title of the book
std::string author; // Stores the author's name
std::string isbn; // Stores the unique ISBN of the book

public:
// Constructor to initialize the book's attributes
Book(const std::string& title, const std::string& author, const std::string& isbn);

// Getters to retrieve book attributes
std::string getTitle() const;
std::string getAuthor() const;
std::string getISBN() const;

// Setters to modify book attributes
void setTitle(const std::string& title);
void setAuthor(const std::string& author);
void setISBN(const std::string& isbn);
};

#endif // BOOK_H
34 changes: 34 additions & 0 deletions Project/ProjectCpp/book_item.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Source: book_item.cpp
#include "book_item.h"
#include <iostream>

// Constructor implementation
BookItem::BookItem(const std::string& title, const std::string& author, const std::string& isbn)
: LibraryItem(title), author(author), isbn(isbn) {}

// Getter for the author's name
std::string BookItem::getAuthor() const { return author; }

// Getter for the ISBN
std::string BookItem::getISBN() const { return isbn; }

// Setter for the author's name
void BookItem::setAuthor(const std::string& author) { this->author = author; }

// Setter for the ISBN
void BookItem::setISBN(const std::string& isbn) { this->isbn = isbn; }

// Prints all details of the book, including availability status
void BookItem::printDetails() const {
std::cout << "Title: " << getTitle() << "\n"
<< "Author: " << author << "\n"
<< "ISBN: " << isbn << "\n"
<< "Checked Out: " << (getIsCheckedOut() ? "Yes" : "No") << "\n"
<< "Due Date: " << getDueDate() << "\n";
}

// Calculates the late fees for overdue books
double BookItem::calculateLateFees(int daysOverdue) const {
const double feePerDay = 0.5; // Fee rate per day
return daysOverdue * feePerDay;
}
31 changes: 31 additions & 0 deletions Project/ProjectCpp/book_item.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Header: book_item.h
#ifndef BOOK_ITEM_H
#define BOOK_ITEM_H

#include "library_item.h"

class BookItem : public LibraryItem {
private:
std::string author; // Author of the book
std::string isbn; // ISBN of the book

public:
// Constructor to initialize book-specific details
BookItem(const std::string& title, const std::string& author, const std::string& isbn);

// Getters for book-specific details
std::string getAuthor() const;
std::string getISBN() const;

// Setters for book-specific details
void setAuthor(const std::string& author);
void setISBN(const std::string& isbn);

// Prints details of the book
void printDetails() const;

// Calculates late fees based on the number of overdue days
double calculateLateFees(int daysOverdue) const;
};

#endif // BOOK_ITEM_H
Loading