Can I please get some guidance ?

I have a c++ assignment that I need help with. I don't know much c++ b/c my teacher barely taught it. I gave it my best shot so far but I'm sure I'm not on the right track. Here is the assignment.

For this assignment you will be required to write a C++ program which accepts a text file containing a list of books that will be stored in an array. The size of the array should be of 200 that is stored in a constant called TABLE_SIZE.

Here is the format of the input file, each field entered on a separate line:

Title
Author
Publisher
ISBN

Title, Author and Publisher are Strings which can contain spaces and are at most 40 characters each in length.
ISBN is a 10-digit number.
Each 4 lines in the input file (one for Title, one for Author, and so on) , will contain the information for one book record.
In the case of a duplicate ISBN in the input file, print an error message, ignore the entry (i.e. ignore all information for this book), and continue processing the file. No other error checking is required for this assignment.
Your program should consist of the following classes:
1) Write a fully documented class called BookRecord. It should contain three string member variables, one for the book's Title, one for book's Author and one for book's Publisher. Also, it should contain an integer data member for the ISBN. You should provide a constructor along with accessor and mutator methods for each data member.
2) Write a fully documented class called ListRecords which takes the name of an input file as a parameter to its constructor. The constructor will then create an array of size TABLE_SIZE and will create a record for each of the 4 lines that reads from the input file. The newly created record will be inserted in the array. In order to be able to look for a specific record, you should scan through the array and check each record until the required record is found. In addition, you should provide three member functions called insertBookInfo(), printBookInfo(), printListByISBN() and printListByTitle(). The function insertBookInfo() takes a parameter of type BookRecord and inserts that record into the array. The function printBookInfo() accepts an ISBN number as a parameter and will print all the information about a book with the given ISBN number, if such a BookRecord object exists in the array, or print an error message if there is no book with that ISBN number. The printListByISBN() prints the list soretd by ISBN in incresing order, and printListByTitle() prints the list sorted alphabetically by title. You may use findPositionOfBook() as a helper function (private) that accepts an ISBN number as a parameter and returns the location in the array of a BookRecord object in the array that has the given ISBN number, if it exists, or -1 if such an object does not exists. Here is a list of the function prototypes:

void ListRecords::insertBookInfo(BookRecord record);
void ListRecords::printBookInfo(int bookISBN);
void ListRecords::printListByISBN();
void ListRecords::printListByTitle();

NOTE: In this assignment, you will not need to deal with removals of items in the array.
3) Write a driver program to test the ListRecords class. Begin by prompting the user for the name of an input file from the keyboard and construct a ListRecords object based on the input. Next, provide the user with the following menu of options:
1) Insert a book record into the list
2) Print information of a book with the given ISBN number
3) Print the list of books sorted by ISBN
4) Print the list of books sorted alphabetically by title.
5) Quit the program

4) Extra Credit: Define two subclasses of the BookRecord class called InfoBookRecord and TypeBookRecord. The InfoBookRecord class will contain additional fields for Price and Author's Biography (a double and string, respectively). The TypeBookRecord class will contain an additional field for the type of book (Example: "Novel", "Fantasy", "Biography", etc) (a string of 15 characters). For each class, you must either override the printBookInfo function or make use of virtual functions so that it will print out the additional appropriate data. If you choose to use virtual functions in doing this, you will receive additional extra credit. It is recommended that you use public inheritance when defining these subclasses. All data read in from the input file is to be considered as the parent class, BookRecord, and will not contain any of this additional information. You must add additional menu options to the driver class for adding these different books to the ListRecords in an appropriate format.
Your program should also follow the following requirements:
You must prompt the user for the name of the input file, which the user will then enter by using the keyboard
Your program must be written in C++ to receive any credit. You should only use C++ input/output functions.
You must use at least the three classes listed above
Your output should be printed in a neatly formatted fashion (see SAMPLE OUTPUT below)
If there is an error reading from the file or if any user input is invalid you should inform the user of the situation.
In the event that the user input is invalid, you must ignore request and present the user with the menu once again.
Your program should make good use of functions and be well commented
You must include a "makefile" which correctly compiles your multiple source files

SAMPLE PROGRAM

Enter a file name: books.txt

Select an option from the following menu:
1)Insert a new book into the list
2)Print the info of a specific book by ISBN number
3)Print the list sorted by ISBN
4)Print the list sorted alphabetically by title
5)Quit the program
Please select an option: 2

Enter an ISBN number:0345325818
The record you requested was not found in the list

Select an option from the following menu:
1)Insert a new book into the list
2)Print the info of a specific book by ISBN number
3)Print the list sorted by ISBN
4)Print the list sorted alphabetically by title
5)Quit the program
Please select an option: 2

Enter an ISBN number: 0201183994
A Book on C
Al Kelly and Ira Pohl
Addison-Wesley, Fifth Edition 1998.
ISBN 0201183994



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#include <iostream>
#include <fstream>
#include <string.h>


using namespace std;

const unsigned TABLE_SIZE=200;

int main() {

	string filename;

	
	int option;
	string Title = getTitle();

	cout<<"Enter filename";
	cin>>filename;

	cout<<" Select an option from the menu: ";
	cout<<"1)Insert a new book into the list";
	cout<<"2)Print the info of a specific book by ISBN number ";
	cout<<"3)Print the list sorted by ISBN ";
	cout<<"4)Print the list sorted alphabetically by title";
	cout<<"5)Quit the program";
	cout<<"Please select an option";
	cin>>option;

	if(option==1) {

		cout<<"Enter book's title";
		cin>>Title;

		cout<<"Enter author's name " ;
		cin>>Author;

		cout<<"Enter book's publisher";
		cin>>Publisher;

		cout<<"Enter book's ISBN";
		cin>>Isbn;

	}
	else if( option==2) {
		
		cout<<"Enter ISBN";
		cin>>Isbn;

	}

	else if(option==3) {

		cout<<"        Title                 Author               publisher           ISBN";
        cout<<" ---------------------- ---------------------- ---------------------- ---------- " ; 

	}

	else if( option==4) {

		cout<<"        Title                 Author               publisher           ISBN";
        cout<<" ---------------------- ---------------------- ---------------------- ---------- " ; 
                         
	}
	else
		cout<<"You have quit the program";



	class BookRecord {

		string Title ;
		
		string Author ;

		string Publisher ;

		int Isbn;

	public :
		BookRecord() {
		}
		


	string BookRecord ::getTitle (){


     return Title;
   }
		  string BookRecord::getAuthor() {

			  return Author;

		  }

		  string BookRecord::getPublisher() {

			  return Publisher;


	}

		  void BookRecord ::Title (string s){
			  
			  Title = s;

     
   }
		  void BookRecord::Author( string a) {

			  Author = a;

		  }

		  void  BookRecord::Publisher(string p) {

			   Publisher = p;



		  class ListRecords {

			  ListRecords(filename) {

			  }


	}
		  }
Where is the problem?
There's still a lot more to do. For example,
I didn't do this

Write a fully documented class called ListRecords which takes the name of an input file as a parameter to its constructor. The constructor will then create an array of size TABLE_SIZE and will create a record for each of the 4 lines that reads from the input file. The newly created record will be inserted in the array. In order to be able to look for a specific record, you should scan through the array and check each record until the required record is found. In addition, you should provide three member functions called insertBookInfo(), printBookInfo(), printListByISBN() and printListByTitle(). The function insertBookInfo() takes a parameter of type BookRecord and inserts that record into the array. The function printBookInfo() accepts an ISBN number as a parameter and will print all the information about a book with the given ISBN number, if such a BookRecord object exists in the array, or print an error message if there is no book with that ISBN number. The printListByISBN() prints the list soretd by ISBN in incresing order, and printListByTitle() prints the list sorted alphabetically by title. You may use findPositionOfBook() as a helper function (private) that accepts an ISBN number as a parameter and returns the location in the array of a BookRecord object in the array that has the given ISBN number, if it exists, or -1 if such an object does not exists. Here is a list of the function prototypes:

void ListRecords::insertBookInfo(BookRecord record);
void ListRecords::printBookInfo(int bookISBN);
void ListRecords::printListByISBN();
void ListRecords::printListByTitle();
anyone??
Can someone please help?
Come on guys. It's due at 3pm and I really need help. I didn't start last minute. I've been working on it for a few days now. Please try to help. My professor has barely taught c++ but he's giving hard assignments. I really need the help so please find it in your heart to at least try to reply.
There's still a lot more to do. For example,
I didn't do this


Try writing it and if you get stuck then you can ask for help.
Topic archived. No new replies allowed.