my program wont run on my computer and im not understanding why. please help. #i
ID: 3574887 • Letter: M
Question
my program wont run on my computer and im not understanding why. please help.
#include<iostream>
#include<iomanip>
#include<string>
#include "bookdata.h"
#include "bookinfo.h"
#include "invmenu.h"
#include "reports.h"
#include "cashier.h"
using namespace std;
const int ARRAYNUM = 20;
BookData bookdata[ARRAYNUM];
int main ()
{
bool userChoice = false;
while(userChoice == false)
{
int userInput = 0;
bool trueFalse = false;
cout << " " << setw(45) << "Serendipity Booksellers "
<< setw(39) << "Main Menu "
<< "1.Cashier Module "
<< "2.Inventory Database Module "
<< "3.Report Module "
<< "4.Exit ";
do{
cout << " Enter your choice: ";
cin >> userInput;
if(userInput >= 1 && userInput <= 4)
{ trueFalse = true; }
else
{ cout << " Please enter a number in the range 1 - 4. "; }
}while(trueFalse != true);
switch(userInput)
{
case 1: cashier(); break;
case 2: invmenu(bookdata,ARRAYNUM); break;
case 3: reports(); break;
case 4:
cout << " Exiting Program ";
userChoice = true;
break;
}
}
return 0;
}
//bookdata.cpp
#include<iostream>
#include<iomanip>
#include<string>
#include "bookdata.h"
using namespace std;
BookData::BookData()
{
bookTitle = "";
isbn = "";
author = "";
publisher = "";
dateAdded = "";
qtyOnHand = 0;
wholesale = 0;
retail = 0;
Empty = true;
};
void BookData::setTitle(string t)
{ bookTitle = t; };
void BookData::setIsbn(string i)
{ isbn = i; };
void BookData::setAuthor(string a)
{ author = a; };
void BookData::setPub(string p)
{ publisher = p; };
void BookData::setDateAdded(string d)
{dateAdded = d; };
void BookData::setQty(int q)
{ qtyOnHand = q; };
void BookData::setWholesale(double w)
{ wholesale = w; };
void BookData::setRetail(double r)
{ retail = r; };
bool BookData::isEmpty()
{ return Empty; };
void BookData::insertBook()
{ Empty = false; };
void BookData::removeBook()
{ Empty = true; };
string BookData::getTitle()
{ return bookTitle; };
string BookData::getIsbn()
{ return isbn; };
string BookData::getAuthor()
{ return author; };
string BookData::getPub()
{ return publisher; };
string BookData::getDateAdded()
{ return dateAdded; };
int BookData::getQty()
{ return qtyOnHand; };
double BookData::getWholesale()
{ return wholesale; };
double BookData::getRetail()
{ return retail; };
//bookdata.h
#include<iostream>
#include<iomanip>
using namespace std;
class BookData
{
private:
string bookTitle;
string isbn;
string author;
string publisher;
string dateAdded;
int qtyOnHand;
double wholesale;
double retail;
bool Empty;
public:
BookData();
void setTitle(string);
void setIsbn(string);
void setAuthor(string);
void setPub(string);
void setDateAdded(string);
void setQty(int);
void setWholesale(double);
void setRetail(double);
bool isEmpty();
void insertBook();
void removeBook();
string getTitle();
string getIsbn();
string getAuthor();
string getPub();
string getDateAdded();
int getQty();
double getWholesale();
double getRetail();
};
//bookinfo.cpp
#include<iostream>
#include<iomanip>
#include<string>
#include "bookdata.h"
#include "bookinfo.h"
using namespace std;
void bookinfo (BookData d[], int i)
{
cout << setw(45) << "Serendipity Booksellers "
<< setw(42) << "Book Information ";
cout << " ISBN: " << d[i].getIsbn()
<< " Title: " << d[i].getTitle()
<< " Author: " << d[i].getAuthor()
<< " Publisher: " << d[i].getPub()
<< " Date Added: " << d[i].getDateAdded()
<< " Quantity-On-Hand: " << d[i].getQty()
<< fixed << setprecision(2)
<< " Wholesale Cost: $" << d[i].getWholesale()
<< " Retail Price: $" << d[i].getRetail() << " ";
}
//bookinfo.h
#include<iostream>
#include<iomanip>
using namespace std;
void bookinfo(BookData[], int);
//cashier.cpp
#include<iostream>
#include<iomanip>
#include<string>
#include "cashier.h"
#include "bookdata.h"
using namespace std;
void cashier ()
{
bool userChoice = false;
while(userChoice == false)
{
string dateBook, codeBook, titleBook;
int numBook;
double priceBook;
cout << " Serendipity Booksellers"
<< " Cashier Module ";
cout << "Date: ";
cin >> dateBook;
cout << "Quantity of Book: ";
cin >> numBook;
cout << "ISBN: ";
cin >> codeBook;
cout << "Title: ";
cin >> titleBook;
cout << "Price: ";
cin >> priceBook;
cout << " ";
cout << "Serendipity Booksellers "
<< "Date: " << dateBook << " ";
cout << setw(5) << left << "Qty "
<< setw(8) << left << " ISBN "
<< setw(15) << left << " Title "
<< setw(6) << left << " Price "
<< setw(6) << left << " Total ";
cout << "------------------------------------------ ";
cout << fixed << setprecision(2)
<< setw(5) << numBook
<< setw(8) << codeBook
<< setw(15) << titleBook
<< "$" << setw(6) << priceBook
<< "$" << setw(6) << (numBook * (priceBook * 1.06)) << " ";
cout << " " << setw(15) << right << "Subtotal:" << setw(20) << "$" << priceBook
<< " " << setw(15) << right << "Tax:" << setw(20) << "$" << (numBook * (priceBook * .06))
<< " " << setw(15) << right << "Total:" << setw(20) << "$" << (numBook * (priceBook * 1.06))
<< " Thank You For Shopping Serendipity! ";
char choice = NULL;
cout << " Is there another transaction that is to be processed?(y/n): ";
cin >> choice;
if( choice == 'n' || choice == 'N' ){userChoice = true;}
}
}
//cashier.h
#include<iostream>
#include<iomanip>
using namespace std;
void cashier();
//invmenu.cpp
#include<iostream>
#include<iomanip>
#include<string>
#include"bookdata.h"
#include"bookinfo.h"
#include"invmenu.h"
using namespace std;
void invmenu(BookData bookdata[], const int NUM)
{
bool userChoice = false;
while(userChoice == false)
{
int userInput = 0;
bool trueFalse = false;
cout << " " << setw(45) << "Serendipity Booksellers "
<< setw(43) << "Inventory Database "
<< "1.Look-up a Book "
<< "2.Add a Book "
<< "3.Edit a Book's Record "
<< "4.Delete a Book "
<< "5.Return to the Main Menu ";
do{
cout << " Enter your choice: ";
cin >> userInput;
if(userInput >= 1 && userInput <= 5)
{ trueFalse = true; }
else
{ cout << " Please enter a number in the range 1 - 5. "; }
}while(trueFalse != true);
switch(userInput)
{
case 1: lookUpBook(bookdata); break;
case 2: addBook(bookdata); break;
case 3: editBook(bookdata); break;
case 4: deleteBook(bookdata); break;
case 5:
userChoice = true;
break;
}
}
}
void lookUpBook(BookData d[])
{
string u = "";
int b = 0;
cout << " Enter the Title or IBSN: ";
cin >> u;
b = findBook(d, u);
if( b == -1 )
{ cout << " Book not found."; }
else
{bookinfo(d, b); }
}
int findBook(BookData d[], string u)
{
int fb = 0;
for(int i = 0; i < 20; i++)
{
cout << " Bonk " << i << " ";
if(u == d[i].getTitle() || u == d[i].getIsbn())
{ fb = i; break; }
else
{fb = -1;}
}
return fb;
}
void addBook(BookData d[])
{
int space;
for(int i = 0; i <= 20; i++)
{
//cout << " Bonk " << i << " ";
if(d[i].isEmpty() != false)
{ space = i; break; }
}
if(space != -1)
{
string temp = "";
int t = 0;
double td = 0;
d[space].insertBook();
cout << "Book Title: "; cin >> temp; d[space].setTitle(temp);
cout << "ISBN: "; cin >> temp; d[space].setIsbn(temp);
cout << "Author: "; cin >> temp; d[space].setAuthor(temp);
cout << "Publisher: "; cin >> temp; d[space].setPub(temp);
cout << "Date Added: "; cin >> temp; d[space].setDateAdded(temp);
cout << "Quantity to be Added: "; cin >> t; d[space].setQty(t);
cout << "Wholesale: $"; cin >> td; d[space].setWholesale(td);
cout << "Retail: $"; cin >> td; d[space].setRetail(td);
}
}
void editBook(BookData d[])
{
bool trueFalse = false;
string u = "";
int b = 0;
cout << " Enter the Title or IBSN: ";
cin >> u;
b = findBook(d, u);
if( b == -1 )
{ cout << " Book not found."; trueFalse = true;}
while(trueFalse != true)
{
bookinfo(d, b);
string temp = "";
int t = 0;
double td = 0;
cout << " Edit 1.Title 2.ISBN 3.Author 4.Publisher 5.Date Added 6.Quantity 7.Wholesale "
<< "8.Retail 9.Exit ";
bool aaa = false;
do{
cout << " Enter your choice: ";
cin >> t;
if(t >= 1 && t <= 9)
{ aaa = true; }
else
{ cout << " Please enter a number in the range 1 - 9. "; }
}while(aaa != true);
switch(t)
{
case 1: cout << "Book Title: "; cin >> temp; d[b].setTitle(temp); break;
case 2: cout << "ISBN: "; cin >> temp; d[b].setIsbn(temp); break;
case 3: cout << "Author: "; cin >> temp; d[b].setAuthor(temp); break;
case 4: cout << "Publisher: "; cin >> temp; d[b].setPub(temp); break;
case 5: cout << "Date Added: "; cin >> temp; d[b].setDateAdded(temp); break;
case 6: cout << "Quantity to be Added: "; cin >> t; d[b].setQty(t); break;
case 7: cout << "Wholesale: $"; cin >> td; d[b].setWholesale(td); break;
case 8: cout << "Retail: $"; cin >> td; d[b].setRetail(td); break;
default: trueFalse = true;
}
}
}
void deleteBook(BookData d[])
{
string u = "";
char c = '0';
int b = 0;
cout << " Enter the Title or IBSN: ";
cin >> u;
b = findBook(d, u);
if( b == -1 )
{ cout << " Book not found."; }
else
{
bookinfo(d, b);
cout << " Do you wish to delete this book?(y/n): ";
cin >> c;
if(c == 'y' || c == 'Y')
{
cout << " Book has been deleted!";
d[b].removeBook();
}
}
}
//invmenu.h
void invmenu(BookData[], const int);
int findBook(BookData[], string);
void lookUpBook(BookData[]);
void addBook(BookData[]);
void editBook(BookData[]);
void deleteBook(BookData[]);
//reports.cpp
#include<iostream>
#include<iomanip>
#include<string>
#include "reports.h"
#include "bookdata.h"
using namespace std;
void reports ()
{
bool userChoice = false;
while(userChoice == false)
{
int userInput = 0;
bool trueFalse = false;
cout << " " << setw(45) << "Serendipity Booksellers "
<< setw(38) << "Reports "
<< "1.Inventory Listing "
<< "2.Inventory Wholesale Value "
<< "3.Inventory Retail Value "
<< "4.Listing by Quantity "
<< "5.Listing by Cost "
<< "6.Listing by Age "
<< "7.Return to the Main Menu ";
do{
cout << " Enter your choice: ";
cin >> userInput;
if(userInput >= 1 && userInput <= 7)
{ trueFalse = true; }
else
{ cout << " Please enter a number in the range 1 - 7. "; }
}while(trueFalse != true);
switch(userInput)
{
case 1: repListing(); break;
case 2: repWholesale(); break;
case 3: repRetail(); break;
case 4: repQty(); break;
case 5: repCost(); break;
case 6: repAge(); break;
case 7:
userChoice = true;
break;
}
}
}
void repListing(){
cout << " You selected Inventory Listing ";}
void repWholesale(){
cout << " You selected Inventory Wholesale Value ";}
void repRetail(){
cout << " You selected Inventory Retail Value ";}
void repQty(){
cout << " You selected Inventory Listing By Quantity ";}
void repCost(){
cout << " You selected Inventory Listing By Cost ";}
void repAge(){
cout << " You selected Inventory Listing By Age ";}
//reports.h
#include<iostream>
#include<iomanip>
using namespace std;
void reports();
void repListing();
void repWholesale();
void repRetail();
void repQty();
void repCost();
void repAge();
Explanation / Answer
#include<iostream>
#include<iomanip>
#include<string>
#include "bookdata.cpp"
#include "bookinfo.cpp"
#include "invmenu.cpp"
#include "reports.cpp"
#include "cashier.cpp"
using namespace std;
const int ARRAYNUM = 20;
BookData bookdata[ARRAYNUM];
int main ()
{
bool userChoice = false;
while(userChoice == false)
{
int userInput = 0;
bool trueFalse = false;
cout << " " << setw(45) << "Serendipity Booksellers "
<< setw(39) << "Main Menu "
<< "1.Cashier Module "
<< "2.Inventory Database Module "
<< "3.Report Module "
<< "4.Exit ";
do{
cout << " Enter your choice: ";
cin >> userInput;
if(userInput >= 1 && userInput <= 4)
{ trueFalse = true; }
else
{ cout << " Please enter a number in the range 1 - 4. "; }
}while(trueFalse != true);
switch(userInput)
{
case 1: cashier(); break;
case 2: invmenu(bookdata,ARRAYNUM); break;
case 3: reports(); break;
case 4:
cout << " Exiting Program ";
userChoice = true;
break;
}
}
return 0;
}
///////////////////////////////////////////////////////////////////
//bookdata.h
#ifndef bookdata_H
#define bookdata_H
#include<iostream>
#include<iomanip>
using namespace std;
class BookData
{
private:
string bookTitle;
string isbn;
string author;
string publisher;
string dateAdded;
int qtyOnHand;
double wholesale;
double retail;
bool Empty;
public:
BookData();
void setTitle(string);
void setIsbn(string);
void setAuthor(string);
void setPub(string);
void setDateAdded(string);
void setQty(int);
void setWholesale(double);
void setRetail(double);
bool isEmpty();
void insertBook();
void removeBook();
string getTitle();
string getIsbn();
string getAuthor();
string getPub();
string getDateAdded();
int getQty();
double getWholesale();
double getRetail();
};
#endif
////////////////////////////////////////////////////
//bookdata.cpp
#include<iostream>
#include<iomanip>
#include<string>
#include "bookdata.h"
using namespace std;
BookData::BookData()
{
bookTitle = "";
isbn = "";
author = "";
publisher = "";
dateAdded = "";
qtyOnHand = 0;
wholesale = 0;
retail = 0;
Empty = true;
};
void BookData::setTitle(string t)
{ bookTitle = t; };
void BookData::setIsbn(string i)
{ isbn = i; };
void BookData::setAuthor(string a)
{ author = a; };
void BookData::setPub(string p)
{ publisher = p; };
void BookData::setDateAdded(string d)
{dateAdded = d; };
void BookData::setQty(int q)
{ qtyOnHand = q; };
void BookData::setWholesale(double w)
{ wholesale = w; };
void BookData::setRetail(double r)
{ retail = r; };
bool BookData::isEmpty()
{ return Empty; };
void BookData::insertBook()
{ Empty = false; };
void BookData::removeBook()
{ Empty = true; };
string BookData::getTitle()
{ return bookTitle; };
string BookData::getIsbn()
{ return isbn; };
string BookData::getAuthor()
{ return author; };
string BookData::getPub()
{ return publisher; };
string BookData::getDateAdded()
{ return dateAdded; };
int BookData::getQty()
{ return qtyOnHand; };
double BookData::getWholesale()
{ return wholesale; };
double BookData::getRetail()
{ return retail; };
/////////////////////////////////////////////////
//bookinfo.h
#ifndef bookinfo_H
#define bookinfo_H
#include<iostream>
#include<iomanip>
using namespace std;
void bookinfo(BookData[], int);
#endif
////////////////////////////////////////////////////
//bookinfo.cpp
#include<iostream>
#include<iomanip>
#include<string>
#include "bookdata.h"
#include "bookinfo.h"
using namespace std;
void bookinfo (BookData d[], int i)
{
cout << setw(45) << "Serendipity Booksellers "
<< setw(42) << "Book Information ";
cout << " ISBN: " << d[i].getIsbn()
<< " Title: " << d[i].getTitle()
<< " Author: " << d[i].getAuthor()
<< " Publisher: " << d[i].getPub()
<< " Date Added: " << d[i].getDateAdded()
<< " Quantity-On-Hand: " << d[i].getQty()
<< fixed << setprecision(2)
<< " Wholesale Cost: $" << d[i].getWholesale()
<< " Retail Price: $" << d[i].getRetail() << " ";
}
////////////////////////////////////////////////////////
//cashier.h
#ifndef cashier_H
#define cashier_H
#include<iostream>
#include<iomanip>
using namespace std;
void cashier();
#endif
///////////////////////////////////////////////////
//cashier.cpp
#include<iostream>
#include<iomanip>
#include<string>
#include "cashier.h"
#include "bookdata.h"
using namespace std;
void cashier ()
{
bool userChoice = false;
while(userChoice == false)
{
string dateBook, codeBook, titleBook;
int numBook;
double priceBook;
cout << " Serendipity Booksellers"
<< " Cashier Module ";
cout << "Date: ";
cin >> dateBook;
cout << "Quantity of Book: ";
cin >> numBook;
cout << "ISBN: ";
cin >> codeBook;
cout << "Title: ";
cin >>titleBook;
cout << "Price: ";
cin >> priceBook;
cout << " ";
cout << "Serendipity Booksellers "
<< "Date: " << dateBook << " ";
cout << setw(5) << left << "Qty "
<< setw(8) << left << " ISBN "
<< setw(15) << left << " Title "
<< setw(6) << left << " Price "
<< setw(6) << left << " Total ";
cout << "------------------------------------------ ";
cout << fixed << setprecision(2)
<< setw(5) << numBook
<< setw(8) << codeBook
<< setw(15) << titleBook
<< "$" << setw(6) << priceBook
<< "$" << setw(6) << (numBook * (priceBook * 1.06)) << " ";
cout << " " << setw(15) << right << "Subtotal:" << setw(20) << "$" << priceBook
<< " " << setw(15) << right << "Tax:" << setw(20) << "$" << (numBook * (priceBook * .06))
<< " " << setw(15) << right << "Total:" << setw(20) << "$" << (numBook * (priceBook * 1.06))
<< " Thank You For Shopping Serendipity! ";
char choice;
cout << " Is there another transaction that is to be processed?(y/n): ";
cin >> choice;
if( choice == 'n' || choice == 'N' ){userChoice = true;}
}
}
////////////////////////////////////////////////////////
//invmenu.h
#ifndef invmenu_H
#define invmenu_H
void invmenu(BookData[], const int);
int findBook(BookData[], string);
void lookUpBook(BookData[]);
void addBook(BookData[]);
void editBook(BookData[]);
void deleteBook(BookData[]);
#endif
///////////////////////////////////////////////////////
//reports.cpp
#include<iostream>
#include<iomanip>
#include<string>
#include "reports.h"
#include "bookdata.h"
using namespace std;
void reports ()
{
bool userChoice = false;
while(userChoice == false)
{
int userInput = 0;
bool trueFalse = false;
cout << " " << setw(45) << "Serendipity Booksellers "
<< setw(38) << "Reports "
<< "1.Inventory Listing "
<< "2.Inventory Wholesale Value "
<< "3.Inventory Retail Value "
<< "4.Listing by Quantity "
<< "5.Listing by Cost "
<< "6.Listing by Age "
<< "7.Return to the Main Menu ";
do{
cout << " Enter your choice: ";
cin >> userInput;
if(userInput >= 1 && userInput <= 7)
{ trueFalse = true; }
else
{ cout << " Please enter a number in the range 1 - 7. "; }
}while(trueFalse != true);
switch(userInput)
{
case 1: repListing(); break;
case 2: repWholesale(); break;
case 3: repRetail(); break;
case 4: repQty(); break;
case 5: repCost(); break;
case 6: repAge(); break;
case 7:
userChoice = true;
break;
}
}
}
void repListing(){
cout << " You selected Inventory Listing ";}
void repWholesale(){
cout << " You selected Inventory Wholesale Value ";}
void repRetail(){
cout << " You selected Inventory Retail Value ";}
void repQty(){
cout << " You selected Inventory Listing By Quantity ";}
void repCost(){
cout << " You selected Inventory Listing By Cost ";}
void repAge(){
cout << " You selected Inventory Listing By Age ";}
////////////////////////////////////////////////////////////
//invmenu.cpp
#include<iostream>
#include<iomanip>
#include<string>
#include"bookdata.h"
#include"bookinfo.h"
#include"invmenu.h"
using namespace std;
void invmenu(BookData bookdata[], const int NUM)
{
bool userChoice = false;
while(userChoice == false)
{
int userInput = 0;
bool trueFalse = false;
cout << " " << setw(45) << "Serendipity Booksellers "
<< setw(43) << "Inventory Database "
<< "1.Look-up a Book "
<< "2.Add a Book "
<< "3.Edit a Book's Record "
<< "4.Delete a Book "
<< "5.Return to the Main Menu ";
do{
cout << " Enter your choice: ";
cin >> userInput;
if(userInput >= 1 && userInput <= 5)
{ trueFalse = true; }
else
{ cout << " Please enter a number in the range 1 - 5. "; }
}while(trueFalse != true);
switch(userInput)
{
case 1: lookUpBook(bookdata); break;
case 2: addBook(bookdata); break;
case 3: editBook(bookdata); break;
case 4: deleteBook(bookdata); break;
case 5:
userChoice = true;
break;
}
}
}
void lookUpBook(BookData d[])
{
string u = "";
int b = 0;
cout << " Enter the Title or IBSN: ";
cin >> u;
b = findBook(d, u);
if( b == -1 )
{ cout << " Book not found."; }
else
{bookinfo(d, b); }
}
int findBook(BookData d[], string u)
{
int fb = 0;
for(int i = 0; i < 20; i++)
{
cout << " Bonk " << i << " ";
if(u == d[i].getTitle() || u == d[i].getIsbn())
{ fb = i; break; }
else
{fb = -1;}
}
return fb;
}
void addBook(BookData d[])
{
int space;
for(int i = 0; i <= 20; i++)
{
//cout << " Bonk " << i << " ";
if(d[i].isEmpty() != false)
{ space = i; break; }
}
if(space != -1)
{
string temp = "";
int t = 0;
double td = 0;
d[space].insertBook();
cout << "Book Title: "; cin >> temp; d[space].setTitle(temp);
cout << "ISBN: "; cin >> temp; d[space].setIsbn(temp);
cout << "Author: "; cin >> temp; d[space].setAuthor(temp);
cout << "Publisher: "; cin >> temp; d[space].setPub(temp);
cout << "Date Added: "; cin >> temp; d[space].setDateAdded(temp);
cout << "Quantity to be Added: "; cin >> t; d[space].setQty(t);
cout << "Wholesale: $"; cin >> td; d[space].setWholesale(td);
cout << "Retail: $"; cin >> td; d[space].setRetail(td);
}
}
void editBook(BookData d[])
{
bool trueFalse = false;
string u = "";
int b = 0;
cout << " Enter the Title or IBSN: ";
cin >> u;
b = findBook(d, u);
if( b == -1 )
{ cout << " Book not found."; trueFalse = true;}
while(trueFalse != true)
{
bookinfo(d, b);
string temp = "";
int t = 0;
double td = 0;
cout << " Edit 1.Title 2.ISBN 3.Author 4.Publisher 5.Date Added 6.Quantity 7.Wholesale "
<< "8.Retail 9.Exit ";
bool aaa = false;
do{
cout << " Enter your choice: ";
cin >> t;
if(t >= 1 && t <= 9)
{ aaa = true; }
else
{ cout << " Please enter a number in the range 1 - 9. "; }
}while(aaa != true);
switch(t)
{
case 1: cout << "Book Title: "; cin >> temp; d[b].setTitle(temp); break;
case 2: cout << "ISBN: "; cin >> temp; d[b].setIsbn(temp); break;
case 3: cout << "Author: "; cin >> temp; d[b].setAuthor(temp); break;
case 4: cout << "Publisher: "; cin >> temp; d[b].setPub(temp); break;
case 5: cout << "Date Added: "; cin >> temp; d[b].setDateAdded(temp); break;
case 6: cout << "Quantity to be Added: "; cin >> t; d[b].setQty(t); break;
case 7: cout << "Wholesale: $"; cin >> td; d[b].setWholesale(td); break;
case 8: cout << "Retail: $"; cin >> td; d[b].setRetail(td); break;
default: trueFalse = true;
}
}
}
void deleteBook(BookData d[])
{
string u = "";
char c = '0';
int b = 0;
cout << " Enter the Title or IBSN: ";
cin >> u;
b = findBook(d, u);
if( b == -1 )
{ cout << " Book not found."; }
else
{
bookinfo(d, b);
cout << " Do you wish to delete this book?(y/n): ";
cin >> c;
if(c == 'y' || c == 'Y')
{
cout << " Book has been deleted!";
d[b].removeBook();
}
}
}
////////////////////////////////////////////////
//reports.h
#ifndef reports_H
#define reports_H
#include<iostream>
#include<iomanip>
using namespace std;
void reports();
void repListing();
void repWholesale();
void repRetail();
void repQty();
void repCost();
void repAge();
#endif
/////////////////////////////////////////////////////////////
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.