Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Enclose all your source code within the seneca namespace and include the necessary guards in each header fi . Books.txt ( # Author, Title, Country,
Enclose all your source code within the seneca namespace and include the necessary guards in each header fi Books.txt# Author, Title, Country, Price, Year, Summary
#
Miguel de Cervantes, Don Quixote, Spain, The story follows a Hidalgo, Alonso Quixano, who proves that chivalry will in fact never die.
Charles Dickens, A Tale of Two Cities, UK A historical novel, set in London and Paris at teh begiming and during the French Revolution.
George RR Martin, A Song of Ice and Fire, US Nine noble famillies begim fighting for control over teh mythical lands of Westeros.
JRR Tolkien, The Lord of the Rings UK Sauron has gathered to him all teh Rings of Power, and he intends to use them to rule Middleearth.
JK Rowling, Harry Potter, UK Harry realizes his life is far from ordinary.
Dan Brown, The Da Vinci Code, US While in Paris, Harvard symbologist Robert Langdon is awakened by a phone call in teh night.
JD Salinger, The Catcher in teh Rye USThe story of a teen named Holden Caulfield and his struggle to find his voice in an adult world.moviestxt# Author, Title, Country, Price, Year, Summary
#
Miguel de Cervantes, Don Quixote, Spain, The story follows a Hidalgo, Alonso Quixano, who proves that chivalry will in fact never die.
Charles Dickens, A Tale of Two Cities, UK A historical novel, set in London and Paris at teh begiming and during the French Revolution.
George RR Martin, A Song of Ice and Fire, US Nine noble famillies begim fighting for control over teh mythical lands of Westeros.
JRR Tolkien, The Lord of the Rings UK Sauron has gathered to him all teh Rings of Power, and he intends to use them to rule Middleearth.
JK Rowling, Harry Potter, UK Harry realizes his life is far from ordinary.
Dan Brown, The Da Vinci Code, US While in Paris, Harvard symbologist Robert Langdon is awakened by a phone call in teh night.
JD Salinger, The Catcher in teh Rye USThe story of a teen named Holden Caulfield and his struggle to find his voice in an adult world.wpcpp#include
#include
#include
#include "Collection.h
#include "Collection.h intentional
#include "SpellChecker.h
#include "SpellChecker.h intentional
#include "Book.h
#include "Book.h intentional
#include "Movie.h
#include "Movie.h intentional
int cout ; won't compile if headers don't follow convention regarding namespaces
enum AppErrors
CannotOpenFile An input file cannot be opened
BadArgumentCount The application didn't receive anough parameters
;
The observer function for adding books to the collection:
should be called every time a new book is added to the collection
void bookAddedObserverconst seneca::Collection& theCollection,
const seneca::Book& theBook
std::cout "Book theBook.title added!
;
The observer function for adding movies to the collection:
should be called every time a new movie is added to the collection
void movieAddedObserverconst seneca::Collection& theCollection,
const seneca::Movie& theMovie
std::cout "Movie theMovie.title
added to collection theCollection.name
theCollection.size items
;
ws books.txt movies.txt filemissing.txt filewords.txt
int mainint argc, char argv
std::cout "Command Line:
;
std::cout
;
for int i ; i argc; i
std::cout std::setw i : argvi
;
std::cout
;
get the books
seneca::Collection libraryBestsellers;
if argc
TODO: load the first books from the file "argv
read one line at a time, and pass it to the Book constructor
store each book read into the collection "library" use the operator
lines that start with # are considered comments and should be ignored
if the file cannot be open, print a message to standard error console and
exit from application with error code "AppErrors::CannotOpenFile"
Hey, I just met you,
And this is crazy,
But here's my number. register the observer
So if something happens, event
Call me maybe? callback
library.setObserverbookAddedObservI need you to make the program, include all code and output matches
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started