c++ additional code to function that add new user to db
Library.cpp
#include “User.h”
#include “Book.h”
#include “Library.h”
#include
#include
#include
#include
using namespace std;
int Library::readBooks(string bFileName)
{
int chklinesize;
string lines;
string words[200];
ifstream fileBooks;
fileBooks.open(bFileName, ios::in);
if (fileBooks.is_open())
{
while (getline(fileBooks, lines))
{
//Get the length of the lines
chklinesize = lines.length();
//lines = lines.substr(0, chklinesize – 1);
lines = lines.substr(0, chklinesize);
Split(lines, ‘,’, words, 5);
//Update the author and title data members for a Bookoject
Book b(words[1], words[0]);
cout << words[1] << ” by ” << words[0] <<endl;
books[numBooks] = b;
//Update the total number of books in the system (from all thefiles read so far)
numBooks++;
}
return numBooks;
}
else
{
return -1;
}
}
int Library::readRatings(string rFileName)
{
string lines;
string words[200];
int ratings[200];
ifstream fileRate;
fileRate.open(rFileName);
while (getline(fileRate, lines))
{
Split(lines, ‘,’, words, 5);
string username = words[0];
cout << username << “…”
PayPal Gateway not configured
PayPal Gateway not configured