Question: EXPERT CREATE A COMPUTER FLOW DIAGRAM FOR MY CODE #include #include using namespace std; const int MAX _ BOOKS = 1 0 0 ; struct
EXPERT CREATE A COMPUTER FLOW DIAGRAM FOR MY CODE
#include
#include
using namespace std;
const int MAXBOOKS ;
struct Book
string title;
string author;
bool isBorrowed;
;
void addBookBook books int &count;
void viewBooksconst Book books int count;
void borrowBookBook books int count;
void returnBookBook books int count;
int main
Book booksMAXBOOKS;
int count ;
int choice;
do
cout "Library Management System
;
cout Add Book
;
cout View Books
;
cout Borrow Book
;
cout Return Book
;
cout Exit
;
cout "Choose an option: ;
cin choice;
switch choice
case : addBookbooks count; break;
case : viewBooksbooks count; break;
case : borrowBookbooks count; break;
case : returnBookbooks count; break;
case : cout "Exiting...
; break;
default: cout "Invalid option!
; break;
while choice ;
return ;
void addBookBook books int &count
if count MAXBOOKS
cout "Enter book title: ;
cin.ignore;
getlinecin bookscounttitle;
cout "Enter author name: ;
getlinecin bookscountauthor;
bookscountisBorrowed false;
count;
else
cout "Library is full!
;
void viewBooksconst Book books int count
for int i ; i count; i
cout i booksititle by booksiauthor;
if booksiisBorrowed
cout Borrowed;
cout endl;
void borrowBookBook books int count
int index;
viewBooksbooks count;
cout "Select book number to borrow: ;
cin index;
if index && index count && booksindex isBorrowed
booksindex isBorrowed true;
cout "You borrowed booksindex title
;
else
cout "Invalid selection or book already borrowed!
;
void returnBookBook books int count
int index;
viewBooksbooks count;
cout "Select book number to return: ;
cin index;
if index && index count && booksindex isBorrowed
booksindex isBorrowed false;
cout "You returned booksindex title
;
else
cout "Invalid selection or book not borrowed!
;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
