6.3. Write a class LocalPhone that contains an attribute phone to store a local telephone number. The class contains member functions to input and display phone number. Write a child class NatPhone...


In C++




6.3. Write a class LocalPhone that contains an attribute phone to store a local telephone<br>number. The class contains member functions to input and display phone number.<br>Write a child class NatPhone for national phone numbers that inherits LocPhone<br>class. It additionally contains an attribute to store city code. It also contains member<br>functions to input and show the city code. Write another class IntPhone for<br>international phone numbers that inherit NatPhone class. It additionally contains an<br>attribute to store country code. It also contains member functions to input and show<br>the country code. Test these classes from main() by creating objects of derived<br>classes and testing functions in a way that clear concept of multi-level Inheritance.<br>

Extracted text: 6.3. Write a class LocalPhone that contains an attribute phone to store a local telephone number. The class contains member functions to input and display phone number. Write a child class NatPhone for national phone numbers that inherits LocPhone class. It additionally contains an attribute to store city code. It also contains member functions to input and show the city code. Write another class IntPhone for international phone numbers that inherit NatPhone class. It additionally contains an attribute to store country code. It also contains member functions to input and show the country code. Test these classes from main() by creating objects of derived classes and testing functions in a way that clear concept of multi-level Inheritance.

Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here