Ex - 10
Ex - 10
class Employee{
public:
int Emp_id;
string Emp_name;
float Emp_sal;
Emp_id=a;
Emp_name=b;
Emp_sal=c;
void display(){
cout<<"Employee ID :"<<Emp_id<<endl;
};
int main()
Employee e1(123,"Rahul",120000),e2(120,"A",100000);
e1.display();
e2.display();
}
Employee ID :120
Employee Name :A
class Complex{
public:
float real,imag;
Complex(){
real=0;
imag=0;
real=x;
imag=y;
Complex c;
c.real=c1.real+c2.real;
c.imag=c1.imag+c2.imag;
return c;
void show(){
};
int main()
{
Complex c1(3,5),c2(2,5),c3;
c3=c3.add(c1,c2);
c1.show();
c2.show();
c3.show();
return 0;
class Complex{
public:
float real,imag;
Complex(){
real=0;
imag=0;
real=x;
imag=y;
Complex c;
c.real=real+c1.real;
c.imag=imag+c1.imag;
return c;
void show(){
};
int main()
{
Complex c1(3,5),c2(2,5),c3;
c3=c1+c2;
c1.show();
c2.show();
c3.show();
return 0;
class Rectangle {
protected:
double length;
double width;
public:
Rectangle(double l, double w) {
length = l;
width = w;
double area() {
};
private:
double depth;
public:
double volume() {
};
int main() {
return 0;
Area of Rectangle: 50
#include <iostream>
#include <string>
public:
void getData() {
getline(cin, name);
} void display() {
};
private:
double salary;
public:
} void display() {
Employee::display();
};
cout << "Total Experience: " << totalExperience << " years" << endl;
cout << "Number of Projects Handled: " << numberOfProjectsHandled << endl;
};
int main() {
ProjectManager pm;
pm.getData();
pm.display();
return 0;