Hi, this program is supposed to get data from an input file, have the user add new data, then output the new data in an output file. There are also supposed to be inheritance classes for the different titles. The 2 derived classes should be a fiction one and a non-fiction one. I m quite a begginer at classes so i'm not sure how to carry on! Any help would be great, thanks!
------------------------header file------------------------------------------
#ifndef __BOOK_H__
#define __BOOK_H__
class Book
{
private:
char date[11];
int booknum;
char catnum[11];
char title[31];
char author[31];
char type;
public:
//constructor
Book();
//destructor
~Book();
//instance methods
void readdate(); //function to get data from input file
//void adddata(); //function to add new data
void outputdate(); //function to output data into output file
};
#endif
-------------------------------------------------------------------------------
-----------main.cpp---------------------------------------------------------
#include<iostream.h>
#include<stdlib.h>
#include<fstream.h>
#include<cstring>
#include"Book.h"
using namespace std;
int main()
{
return 0;
}
---------------------------------------------------------------------------------
----------implementation file-------------------------------------------------
#include<cstring>
#include"Book.h"
Book::Book()
Book::~Book()
void Book::readdate()
{
ifstream inFile;
inFile.open("BOOKS.dat");
inFile>>date;
cout<<date<<endl;
}
void Book::outputdate()
{
ofstream outFile;
outFile.open("NEWBOOKS.dat");
outFile<<date<<endl;
}
-------------------------------------------------------------------------