rite 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.
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.
Step by step
Solved in 2 steps with 1 images