24.6 BOOKS
class RefBooks
{ private: string40 title ; char ISBN [15]; int qty; float price; public: void getData(); void show(); };
class TextBooks
{ private: string40 title; string15 ISBN; int qty; float price; public: void getData(); void show(); };
Comment: both the classes are nearly same. The class TextBook may have field “author” as String. The class RefBook may have field “editor” as String. An ISBN Number uniquely identifies a book.
Get Object Oriented Programming with C++, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.