Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started