-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
67 lines (60 loc) · 1.89 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <iostream>
#include <vector>
#include "include/Author.h"
#include "include/Admin.h"
#include "include/Book.h"
#include "include/Member.h"
#include "include/User.h"
using namespace std;
void displayMenu();
int main() {
// Create instances of Authors, Books, Admins, and Members
vector<Book*> libraryBooks;
Author author1(1, "John Doe");
Admin admin1(1, "admin", "admin@gmail.com", "adminpass");
Member member1(2, "member", "member@gmail.com", "memberpass");
author1.display();
libraryBooks.push_back(new Book(1, "Book 1", author1, "Genre 1", 5, 10));
libraryBooks.push_back(new Book(2, "Book 2", author1, "Genre 2", 3, 7));
// Author::getAuthorCount();
// Member::getMemberCount();
// Book::getBookCount();
// Display a menu and handle user input
int choice;
do {
displayMenu();
cin >> choice;
switch (choice) {
case 1:
// List Books
// Implement the logic for listing book
break;
case 2:
// Borrow a Book
// Implement the logic for borrowing a book
break;
case 3:
// Return a Book
// Implement the logic for returning a book
break;
case 4:
for(auto book : libraryBooks) {
delete book;
}
cout << "Goodbye!" << endl;
break;
default:
cout << "Invalid option. Please try again." << endl;
}
} while (choice != 4);
// To be implemented in future milestones
return 0;
}
void displayMenu() {
cout << "Library Management System" << endl;
cout << "1. List Books" << endl;
cout << "2. Borrow a Book" << endl;
cout << "3. Return a Book" << endl;
cout << "4. Exit" << endl;
cout << "Select an option: ";
}