[SOLVED] Inheritance Lab :

$25

File Name: Inheritance_Lab_:.zip
File Size: 160.14 KB

5/5 - (1 vote)

Inheritance Lab :

1.1
(1)
(2)
(3)
1.2

1.

//test4_1.cpp
#include using namespace std; class Base{
public:
void setx(int i)
{x=i;}
Int getx()
{return x;} public:
int x;
};
class Derived:public Base{ public:
void sety(int i)
{y=i;}
int gety()
{return y;} void show()
{cout<<Base::x=<
#include using namespace std; class MyArray
{
public: MyArray(int leng);
~MyArray{}; void Input();
void Display(string); protected:
int*alist; int length;
};
MyArray::MyArray(int leng)
{
if(leng<=0){cout<<error length; exit(1);}alist=new int [leng]; length=leng; if(alist==NULL){cout<<assign failure; exit(1);}cout<<MyArray< >*p;
}
int main()
{
MyArray a(5); a.Input();
a.Display();
return 0;
}
(2) SortArray MyArray

1
class SortArray : public MyArray

{
public:
void Sort();
SortArray(int leng):MyArray(leng)
{
cout<<SortArray<

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] Inheritance Lab :
$25