Create class named Book with member variables namely: title, author, publisher, publication date and category (fiction or nonfiction). Also, implement necessary accessor and mutator methods. The...


Create class named Book with member variables namely: title, author, publisher, publication date and category (fiction or nonfiction). Also, implement necessary accessor and mutator methods.


The program will read the 2D array(Array initialization is provided in the booklist.txt file) and construct array of book objects.
Next, the program will display a menu of options and allow the user to search for books which meet certain criteria. The menu options are:




  1. Display all books in a year range: Prompt the user for two years (a starting year and an ending year), then display all books which got published between those two years (inclusive).




  2. Search for an author: Prompt the user for a string, then display all books whose author’s name contains that string (regardless of case).




  3. Display all books for a category: Prompt the user for a string, then display all books whose category matches the user input.




Assignment Notes






1.You may use arrays or vectors to create objects.
2.Be sure to display the books in a reasonable and readable manner.


3.Optional: Create author as a char pointer and create publication date as abstract data type.
4.If no books are found for a particular search, your program will display an appropriate message


5.Your program will continue to execute until the user selects “Q” (or “q”) as the menu option.




string data[][5]= {{"A Breath of Snow and Ashes","Diana Gabaldon","Delacorte","10/16/2005","Fiction"}, {"A Common Life","Jan Karon","Viking","4/29/2001","Fiction"}, {"A Dance With Dragons","George R. R. Martin","Bantam","7/31/2011","Non Fiction"}, {"A Day Late and a Dollar Short","Terry McMillan","Viking","2/4/2001","Fiction"}, {"A Feast For Crows","George R. R. Martin","Bantam","11/27/2005","Fiction"}, {"A Lion Is In the Streets","Adria Locke Langley","McGraw","7/1/1945","Non Fiction"}, {"A Man In Full","Tom Wolfe","Farrar","11/22/1998","Fiction"}, {"A Painted House","John Grisham","Doubleday","2/25/2001","Non Fiction"}, {"A Perfect Spy","John le Carre","Knopf","5/4/1986","Fiction"}, {"A Rage to Live","John O'Hara","Random House","9/18/1949","Fiction"}, {"A Shade of Difference","Allen Drury","Doubleday","10/28/1962","Non Fiction"}, {"A Thousand Splendid Suns","Khaled Hosseini","Riverhead","6/10/2007","Fiction"}, {"A Tree Grows In Brooklyn","Betty Smith","Harper","1/2/1944","Fiction"}, {"A Widow For One Year","John Irving","Random House","6/14/1998","Non Fiction"}, {"Accident","Danielle Steel","Delacorte","2/27/1994","Fiction"}, {"Acheron","Sherrilyn Kenyon","St. Martin's","8/24/2008","Non Fiction"}, {"Across the River and Into the Trees","Ernest Hemingway","Scribner's","10/15/1950","Fiction"}, {"Advise and Consent","Allen Drury","Doubleday","10/4/1959","Non Fiction"}, {"Against All Enemies","Tom Clancy","Putnam","7/3/2011","Non Fiction"}, {"Airframe","Michael Crichton","Knopf","12/29/1996","Fiction"}, {"Airport","Arthur Hailey","Doubleday","4/7/1968","Non Fiction"}, {"Alaska","James Michener","Random House","7/3/1988","Fiction"}, {"Alex Cross's Trial","James Patterson","Brown","9/13/2009","Non Fiction"}, {"American Assassin","Vince Flynn","Atria","10/31/2010","Fiction"}, {"An Indecent Obsession","Colleen McCullough","Harper","11/15/1981","Fiction"}, {"Anansi Boys","Neil Gaiman","Morrow","10/9/2005","Fiction"}, {"Anathem","Neal Stephenson","William Morrow","9/28/2008","Fiction"}, {"Anatomy of a Murder","Robert Traver","St. Martin's","3/9/1958","Non Fiction"}, {"And Now Tomorrow","Rachel Field","MacMillan","8/9/1942","Non Fiction"}, {"Andersonville","McKinley Kantor","World Publishing","1/1/1956","Fiction"}, {"Angels Fall","Nora Roberts","Putnam","7/30/2006","Fiction"}, {"Answered Prayers","Danielle Steel","Delacorte","11/17/2002","Fiction"}, {"Arch of Triumph","Erich Maria Remarque","Appleton-Century","3/10/1946","Fiction"}, {"Armageddon","Tim LaHaye","Tyndale","4/27/2003","Fiction"}, {"At First Sight","Nicholas Sparks","Warner","11/6/2005","Non Fiction"}, {"Bad Moon Rising","Sherrilyn Kenyon","St. Martin's","8/23/2009","Non Fiction"}, {"Bag of Bones","Stephen King","Scribner","10/11/1998","Non Fiction"}, {"Beach Music","Pat Conroy","Talese/Doubleday","7/16/1995","Fiction"}, {"Before I Say Goodbye","Mary Higgins Clark","Simon & Schuster","5/7/2000","Fiction"}, {"Best Friends Forever","Jennifer Weiner","Atria","8/2/2009","Fiction"}};
Apr 21, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here