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

Use C++ please.. The Educated Bookstore Company has asked you to help them write

ID: 3604479 • Letter: U

Question

Use C++ please.. The Educated Bookstore Company has asked you to help them write a Book Purchasing System (BPS). The system can be used to store information about books, customers, members, and selling records (books already bought by a customer/member). A customer is a person who buy books from the bookstore while a member is a VIP customer who are given discount when buys books. The following data about books (ISBN, Title, Author, Price) are saved in a file book.txt: 5-17-525281-3 C++ Programing, Davender Malik, 210 3-7908-1335-4 Discrete Structures, Davender Malik, 185 3-7908-1325-7 Fuzzy Mathematic, Davender Malik, 165 0-239-23635-0 Data Structures, Shih-Chung Cheng, 240 2-99521-453-1 Introduction to Web Programming, Mark Headington, 130 0-521-43681-8 English Grammar in Use, Raymond Murphy, 75 0-7637-8060-x JavaScript, John David Dionisio, 155 0-201-40015-4 Calculus and Analytic geometry, George B. Thomas, 280 0-19-431735-1 Oxford Wordpower, Oxford University, 37 0-86134-022-1 The Camera Book, Mitcheil Beazley, 45
The following data about customers/members (ID, Name, email, number of books) are saved in a file customer.txt, only the ISBNs are saved: 912345678 Saleh Al-Yaaroubi, 912345678@abc.ac.ae, 8 0-239-23635-0 2-99521-453-1 0-521-43681-8 0-7637-8060-x 3-7908-1335-4 0-201-40015-4 0-19-431735-1 3-7908-1325-7 567891234 Khaulah Al-Lawati, 567891234@abc.ac.ae, 1 0-521-43681-8 234567891 Amal Al-Waili, 234567891@abc.ac.ae, 4 0-7637-8060-x 0-201-40015-4 3-7908-1325-7 0-239-23635-0 345678912 Sharifa Al-Mahroqi, 345678912@abc.ac.ae, 7 3-7908-1335-4 5-17-525281-3 0-7637-8060-x 0-19-431735-1 0-521-43681-8 0-86134-022-1 3-7908-1325-7 789123456 Arif Al-Waili, 789123456@abc.ac.ae, 6 3-7908-1325-7 2-99521-453-1 0-521-43681-8 5-17-525281-3 0-86134-022-1 0-201-40015-4 891234567 Abdullah Al-Harthi, 891234567@abc.ac.ae, 3 0-19-431735-1 3-7908-1325-7 0-7637-8060-x 132456789 Talal Al-Zidjali, 132456789@abc.ac.ae, 6 0-521-43681-8 0-19-431735-1 5-17-525281-3 0-201-40015-4 0-86134-022-1 3-7908-1325-7 123456789 Taghreed Al-Saadi, 123456789@abc.ac.ae, 3 2-99521-453-1 5-17-525281-3 0-19-431735-1 678912345 Suleiman Al-Lawati, 678912345@abc.ac.ae, 4 2-99521-453-1 3-7908-1335-4 0-86134-022-1 0-521-43681-8 456789123 Suad Al-Saadi, 456789123@abc.ac.ae, 2 0-239-23635-0 0-19-431735-1

Problem #1: • Define a struct called book that has the components (ISBN, title, author, and price).

Problem #2: • Define a class called Customer that has the private members (ID, name, email, numberOfBooks, an array books[ ] of type book, totalCost) and the function calculateCost( ) that finds the total cost of bought books. The class has the public members set( ), print( ), getTotalCost( ), and a default parametrized constructor. • Implement all member functions of the class.

Problem #3: • Define a class called Member which publicly inherits the class Customer and has the private members discount, netCost, and the function calculateNetCost( ). The class has the public members set( ), print( ), and a default parametrized constructor. • Implement all member functions of the class.

Use the following driver:
int main() { Customer w("789123456"); Member VIP("789123456", 20);
w.print(); VIP.print();
return 0; }
The function set( ) takes only the customer/member ID and then it reads from the file customer.txt the name, email, and number of books. For each book the function reads the ISBN and it looks for the corresponding ISBN in the book.txt file to read the title, author, and price. 789123456 Arif Al-Waili 789123456@abc.ac.ae Bought the following 6 books 3-7908-1325-7 Fuzzy Mathematic 2-99521-453-1 Introduction to Web Programming 0-521-43681-8 English Grammar in Use 5-17-525281-3 C++ Programing 0-86134-022-1 The Cam 0-201-40015-4 Calculus and Analytic geometry Davender Malik Mark Headington Raymond Murphy Davender Malik Mitcheil Beazley George B. Thomas era Boolk The cost of the above books is 905 dirhams 789123456 Arif Al-Waili 789123456@abc.ac.ae Bought the following 6 books 3-7908-1325-7 Fuzzy Mathematic 2-99521-453-1 Introduction to Web Programming 0-521-43681-8 English Grammar in Use 5-17-525281-3 C++ Programing 0-86134-022-1 The Cam 0-201-40015-4 Calculus and Analytic geometry Davender Malik Mark Headington Raymond Murphy Davender Malik Mitcheil Beazley George B. Thomas era Boolk The cost of the above books is 905 dirhams This customer is a member and has a 20% discount The net cost of this member is 724 dirhams

Explanation / Answer

//In C++ structure are defined with the keyword struct and name of the variable in our case we need to make a struct named struct.

struct Book{

//4 variables need to be present in this struct

//ISBN is an integer number so data type will be int

//Title is a string so data type will be string or char str[]

//Author is a string so data type will be string or char str[]

//Price can be decimal value so data type will be float or double

int ISBN;

string title;

string author;

float price;

} ;

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