Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am writing a program that requires a 1.Class specification file (header file)

ID: 3659330 • Letter: I

Question

I am writing a program that requires a 1.Class specification file (header file) and 2. a Implementation File. I have finished writing my 1. Class Specification file and I was wondering if someone can check correct if I wrote my 2. Implementation file correctly. I have posted the assignment below and my codes below.

**************Assignment**********

Book Store Program

You would like to write a program that functions similarly to a book store data base. Your program should read book data

from an inventory file called books.dat that contains best selling book titles, prices, and number of copies. Your program

should store this data in a linked list (each node will contain a title, price, copies, and link to another node).

Your program should allow a user (book store owner) to do several things:


* Type in a title and retrieve the number of copies available.

* Find titles that need to be reordered - this should be done if the number of copies is less than 10.

* Delete a book and its inventory

* Print the book titles in order of price (least to greatest)

* print the list of inventory (all fields).


Add each routine individually and test it before going on to another routine.


************* 1. My Class specification file (header file)****** CORRECT

#include < string>

using namespace std;


class Store

{

private:

string title;

int reorder;

int delete;

double bookprices;

public:

int numOfCopies(string title);

void FindTitleReoreder();

void DeleteBook(int delete);

void PrintBookPrices();

void PrintAll();

};

*************** 2. Implementation file********NEEDS TO BE CHECKED AND CORRECTED Please!

#include "Store.h"

#include <iostream>

#include <iomanip>

#include <string>

using namespace std;


/*

private:

string title;

int reorder;

int delete;

double bookprices;

*/


int Store::numOfCopies(string title)

{

return();

}

void Store::FindTitleReoreder()

{

reutrn(reorder);

}

void Store::DeleteBook(int delete)

{

return(delete);

}

void Store::PrintBookPrices()

{

return(bookprices);

}

void Store::PrintAll()

{

return();

}


Explanation / Answer

there is no error of any type but then again your code for Implementation file does not serves the purpose. you had not used any file to store the book name and infact in the functions like numOfCopies(string title), PrintAll() you are not doing anything. hence the purpose is not solved well i am giving you the code to search the book name i.e. a word from a file, this will help you to find the title and retrieve its number of copies. :) #include #include #include using namespace std; const string &cstrSearch = "Hello"; const string strOutFile = "out.dat"; const string strInFile = "in.dat"; int search_wordmain() { string strTemp; ifstream f(strInFile.c_str()); if (f.bad()) return 1; bool bFound = false; while (!f.eof()){ f>>strTemp; if (strTemp == cstrSearch) { bFound = true; ofstream os(strOutFile.c_str()); os
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote