S No. 1. Questions Answer the questions (i) to (iv) based on the following: class Publisher { char pub[12]; double turnover; protected: void register(); public: Publisher(); void enter(); void display(); } class Branch { char city[20]; protected: float employees; public: Branch(); void haveit(); void giveit(); } class Author: private Branch, public Publisher { int acode; char aname[20]; float amount; public: Author(); void start(); void show(); } i. Write the names of data members, which are accessible from objects belonging to class Author. ii. Write the names of all the member functions which are accessible from objects belonging to class Branch. iii. Write the names of all the members which are accessible from member functions of class Author. iv. How many bytes will be required by an object belonging to class Author?
Added by Steven C.
Close
Step 1
Step 1: From the given code, we can see that class Author is derived privately from class Branch and publicly from class Publisher. Show more…
Show all steps
Your feedback will help us improve your experience
Madhur L and 93 other Algebra educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Define a class taximeter having the following description: Data members/instance variables int taxino - to store taxi number String name - to store passenger's name int km - to store number of kilometers traveled Member functions: taximeter() -- constructor to initialize taxino to 0, name to "" and km to 0. input() - to store taxino, name, km calculate() - to calculate bill for a customer according to given conditions kilometers traveled (km) Rate/km 1 km, Rs 25 1 km <= 6, Rs 10 6 <= 18 km, Rs 25 display() - To display the details in the following format Taxino Name Kilometers traveled Bill amount - - - - Create an object in the main method and call all the above methods in it.
Madhur L.
Akash M.
1. Write a class called Book that includes: a) instance data for the title, author, publisher, and copyright date. b) Define the Book constructor to accept and initialize this data. c) Include setter and getter methods for all instance data. d) Include a toString method that returns a nicely formatted, multi-line description of the book. See format example below: e) Create a driver class called Bookshelf, whose main method instantiates and updates several Book objects - demonstrate with at least 3 Book objects
Recommended Textbooks
Elementary and Intermediate Algebra
Algebra and Trigonometry
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD