This code must be able to compile on Linux so using headers like <conio.h> or <p
ID: 3815381 • Letter: T
Question
This code must be able to compile on Linux so using headers like <conio.h> or <process.h>, which are windows only headers, wont work with linux.
Also please write the code into sections so that it can be put into several different files: main.cpp, functions.h, class.h, etc.
A makefile for them would be awesome, thanks in advance!
Library Management System
Implement a Library Management System based on the design given at the bottom.
For the purposes of this assignment you will need to create a user interface menu that matches the design as well as implement each of the entities as classes in C++. Not we will be using C++ and you will need to use the g++ version of the compiler.
You may not use any of the C++ STL at this time. You may NOT use Inheritance at this time. It is STRONGLY recommended, in fact it is required, that you use a pattern-based solution. Other methods or designs will significantly increase your development time, stress level, as well as the degree of difficulty for this assignment.
Program Requirements:
Your program will be written in C++ not any other computer language. You will include the steps in your algorithm in your code. You may, of course, paraphrase them if you like.
There should be about 7 cpp files (6 classes and 1 main) and at least 6 header files (1 for each class) if you create a .h for main then you will have 7 header files.
Patrons atrons ounter Add Patron Edit elete Find Sort Print Print List Patron PID Name Standing E-mail Phone Number ailing Address Set/Ge Records Records[ I Counter Register Patron Remove Patron Print Patron Account Print Fines Print Items Checked Out Print Due Dates Print Overdue Items Print Address Mailing Lables Find Patron Account Record Book ID AVID tatus. Fines t/Ge d Fine Remove Fine Catalog Catalogs ounte Edi Delete Sort Print Print L Catalo Bood ID AVID Book Name V Name Status Number O Set/GetExplanation / Answer
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
class Library {
public:
using Card = std::string;
class Book {
public:
using Title = std::string;
Book(Book&&) = default;
Book& operator=(Book&&) = default;
Book(const Book&) = delete;
Book& operator=(const Book&) = delete;
~Book() = default;
Title getTitle() const { return title_; }
private:
friend class Library;
explicit Book(Title title): title_(title) {}
Title title_;
};
bool titleIsAvailable(const Book::Title&) const;
Book checkOutTitle(const Book::Title&, const Library::Card&);
void returnBook(Book book);
private:
struct LessByTitle {
using is_transparent = void;
bool operator()(const Book& a, const Book& b) const { return a.getTitle() < b.getTitle(); }
bool operator()(const Book& a, const std::string& b) const { return a.getTitle() < b; }
bool operator()(const std::string& a, const Book& b) const { return a < b.getTitle(); }
};
std::set<Book, LessByTitle> shelf_;
std::unordered_map<Card, std::vector<Book::Title>> checkoutRecords_;
};