Please can someone help in correcting the following attempt of the questions below. I have included my attempt at the problem
I have been asked to write class definations which does the following among other things in C++.
a) Library needs to able to get the following information about its customers: firstname, last name, address and telephone numbers.
b) the library needs to be able to add customers and books to its records.
Assume these records need not be modified or deleted in any way
c) wrie the implementation of the customers class in C++
iii) Class Customer
D) SUPPOSE THE CUSTOMER WANTS TO FIND A SPECIFIC book and knows the title of the book. Write a program that iterates through its records of books and return to a pointer to the matching book
iv) Class Library
I have been asked to write class definations which does the following among other things in C++.
a) Library needs to able to get the following information about its customers: firstname, last name, address and telephone numbers.
b) the library needs to be able to add customers and books to its records.
Assume these records need not be modified or deleted in any way
Code:
// This program get or request the customer to enter their details and or details of the book.
# include <iostream.h>
# include “Library.h”
int Main ()
{
Void display Customer details (Char*Char[], String);
Void display books details (Char*Char[], double);
Void display books on loan (Char, date)
Void display books due (Char, date);
Void add customers, books (Char*Char[], double);
Void print report details (Char, double, string);
}
Void Library: : display customers details ()
{
cout << “Enter First name” <<endl;
cin >> First name;
cout << “Enter Last Name” <<endl;
cin >> Last name;
cout << “Enter Address” <<endl;
cin >> Address;
cout << “Enter telephone number” <<endl;
cin >> telephone number;
}
Void Library: : Display Book details ()
{
cout << “Enter Title” <<endl;
cin >> Title;
cout << “Enter Author” <<endl;
cin >> Aithor;
cout << “Enter ISDN Number” <<endl;
cin >> ISDN Number;
cout << “Enter Number of pages” <<endl;
cin >> Number of pages;
}
Void Library: : Display book loans ()
{
int on loan date;
int date due returned;
cout << “enter on loan date” <<endl;
cin >> on loan date;
cout << “Enter date due returned” <<endl;
cin >> Date due returned;
}
Void Library: : Add Customer, Books ()
{
cout << “Add First name”<<First name<< “Last name” <<Last name<< “Address” <<Address<< “telephone number” <<telephone number<<endl;
cin >>First name >>last name >>Address >>Telephone number;
cout << “Add Title<< Title<< “Author”<< Author<< “ISDN Number”<< ISDN Number<< “number of pages”<< Number of pages <<endl;
cin >> Title>> Author>> ISDN number>> Number of pages;
}
Void Library: : Display customer loans ()
{
int on loan date;
int date due returned;
cout << “enter on loan date” <<endl;
cin >> on loan date;
cout <<”Enter date due returned” <<endl;
cin >> Date due returned;
}
Void Library: : Print detail report ()
cout << “The details of each customer with loan books is”<<customer<<endl;
cout<< “The detail of each book on loan is”<<book<<endl;
cout << “The detail of loan is” <<loan<<endl;
or
}
Void Library: : print detail report()
cout << “customer”<< “book”<< “loan”<<endl;
cin >> customer>>book>>loan>>endl;
}
Return 0;
iii) Class Customer
Code:
{
Public: : // Modifiers
Customer (); // default constructor
Void display customer details (Char*Char [], String);
Private: : // Queries
Char First name [20], Last name[25];
Char Address;
String Telephone number;
};
iv) Class Library
Code:
{
Public :
Library ();
Void display total records of books (Char, double);
Private:
Char Title, Author;
Double ISDN number, Number of pages
Comment