Based
on the following program answer the question
#include<iostream>
using namespace std;
class Point {
private:
int x, y;
public:
Point(int x1,int y1)
{
x=x1;y=y1;
}
void operator+(Point &pt3);
void show() {cout << "x
= " << x << ", y = " << y; } };
void Point::operator+(Point
&pt3)
{
x += pt3.x;
y += pt3.y;
}
int main()
{
Point pt1(3,2),pt2(5,4);
pt1+pt2;
pt1.show();
return 0;
}
Based
on the following class declaration answer the question
class vehicle
{ int wheels;
public:
void input_data(float,float);
void output_data();
protected:
int passenger;
};
class heavy_vehicle : protected
vehicle {
int diesel_petrol;
protected:
int load;
protected:
int load;
public:
voidread_data(float,float)
voidwrite_data(); };
class bus: private heavy_vehicle {
charTicket[20];
public:
voidfetch_data(char);
voiddisplay_data(); };
};
The data member that can be accessed from the
function displaydata()