Question: c++ implement using only inheritance the basic aim of the questiin is to test the conceot of inheritance so please implement using only inheritance thanks

c++
implement using only inheritance  c++ implement using only inheritance the basic aim of the questiin
is to test the conceot of inheritance so please implement using only
the basic aim of the questiin is to test the conceot of inheritance so please implement using only inheritance thanks

Task1: Write a program that declares two classes one is Student and other is Teacher. You can use any three attribute of each class and also member functions and implement given type of inheritance: Public inheritance Private inheritance Protected inheritance What you can learn through this program write here three lines according to this task in comment. Task 2: Write a program that declares two classes. The parent class is called Simple that has two data member a and b to store two numbers. It also has four member functions Addo) Sub() Mull Divo) The child class is called Complex that overrides all four functions. Each function in the child class checks the value of data members. It calls the corresponding member function in the parent class if the values are greater than 0. Otherwise it displays the error message. Task3: Write a class Person that has attributes of id, name and address. It has a constructor to initialize a member function to input and a member function to display data members. Create 2nd class Student that inherits Person class. It has additional attribute of roll number and marks. It also has member functions to input and display it data members. Create 3 class Scholarship that inherits Student class. It has additional attribute of scholarship name and amount. It also has member functions to input and display its data members. Task 4: Write 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 LocalPhone class. It additionally contains an attributes to store city code. It also contains member function to input and show the city code. Write another class IntPhone for international phone numbers that that inherits NatPhone class. It additionally contains an attribute to store country code. It also contains member functions to input and show the country code. Member functions Constructor Setters and getters

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!