I am writing a program that requires a Class specification file (header file) an
ID: 3659146 • Letter: I
Question
I am writing a program that requires a Class specification file (header file) and I was wondering if someone can check if I wrote my Class specification file correctly. I have posted the assignment below and my code below.**************Assignment**********
Book Store Program
(Use a linked list class similar to that presented in ch 17)
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.
*************My Class specification file (header file)******
#include <string>
using namespace std;
class Store
{
private:
string title;
double reorder;
double delete;
double bookprices;
public:
double FindTitle();
void FindTitleReoreder();
double DeleteBook();
void PrintBookPrices();
void PrintAll();
}; I am writing a program that requires a Class specification file (header file) and I was wondering if someone can check if I wrote my Class specification file correctly. I have posted the assignment below and my code below.
**************Assignment**********
Book Store Program
(Use a linked list class similar to that presented in ch 17)
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.
*************My Class specification file (header file)******
#include <string>
using namespace std;
class Store
{
private:
string title;
double reorder;
double delete;
double bookprices;
public:
double FindTitle();
void FindTitleReoreder();
double DeleteBook();
void PrintBookPrices();
void PrintAll();
};
Explanation / Answer
#include 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(); };Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.