#include <iostream>
using namespace std;
class Employee
{public:
virtual int getSalary()=0;
};
class Developer : public Employee
{
public:
int salary;
int getSalary()
{cin>>salary;
cout<<"Salary of Developer : "<<salary<<"\n";}};
class Driver : public Employee
{public :
int getSalary()
{int salary;
cin>>salary;
cout<<"Salary of Driver : "<<salary;}};
int main() {
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
using namespace std;
class Employee
{public:
virtual int getSalary()=0;
};
class Developer : public Employee
{
public:
int salary;
int getSalary()
{cin>>salary;
cout<<"Salary of Developer : "<<salary<<"\n";}};
class Driver : public Employee
{public :
int getSalary()
{int salary;
cin>>salary;
cout<<"Salary of Driver : "<<salary;}};
int main() {
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
#include
ReplyDeleteusing namespace std;
class Employee
{public:
virtual int getSalary()=0;
};
class Developer : public Employee
{
public:
int salary;
int getSalary()
{cin>>salary;
cout<<"Salary of Developer : "<>salary;
cout<<"Salary of Driver : "<<salary;
return 0;}
};
int main() {
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
some things r fixed
Delete#include
ReplyDeleteusing namespace std;
class Employee
{
public:
virtual int getSalary()=0;
};
class Developer:public Employee
{
public:
int salary;
int getSalary()
{
cin>>salary;
cout<<"Salary of Developer : "<>salary;
cout<<"Salary of Driver : "<<salary;}};
int main() {
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
its not compiling
ReplyDelete#include
ReplyDeleteusing namespace std;
class Employee
{public:
virtual int getSalary()=0;
};
class Developer:public Employee
{
public:
int salary;
int getSalary()
{cin>>salary;
cout<<"Salary of Developer : "<>salary;
cout<<"Salary of Driver : "<<salary;}};
int main() {
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
it works
Delete#include
ReplyDeleteusing namespace std;
class Employee
{
public:
virtual int getSalary()=0;
};
class Developer:public Employee
{
public:
int salary;
int getSalary()
{
cin>>salary;
cout<<"Salary of Developer : "<>salary;
cout<<"Salary of Driver : "<<salary;
}
};
int main()
{
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
This works!
#include
ReplyDeleteusing namespace std;
class Employee
{
public:
virtual int getSalary()=0;
};
class Developer:public Employee
{
public:
int salary;
int getSalary()
{
cin>>salary;
cout<<"Salary of Developer : "<>salary;
cout<<"Salary of Driver : "<<salary;
}
};
int main()
{
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
Try this
If the above doesn't work..please change,"cout<<"Salary of Developer : "<>salary;" to cout<<"Salary of Developer : "<<salary;
ReplyDeleteit just has space issues: this works 100%(include iostream)
ReplyDelete#include
using namespace std;
class Employee
{public:
virtual int getSalary()=0;
};
class Developer:public Employee
{
public:
int salary;
int getSalary()
{cin>>salary;
cout<<"Salary of Developer : "<>salary;
cout<<"Salary of Driver : "<<salary;}};
int main() {
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
#include
ReplyDeleteusing namespace std;
class Employee
{public:
virtual int getSalary()=0;
};
class Developer:public Employee
{
public:
int salary;
int getSalary()
{
cin>>salary;
cout<<"Salary of Developer : "<>salary;
cout<<"Salary of Driver : "<<salary<<endl;
}
};
int main() {
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
#include
ReplyDeleteusing namespace std;
class Employee
{
public:
virtual int getSalary()=0;
};
class Developer:public Employee
{
public:
int salary;
int getSalary()
{
cin>>salary;
cout<<"Salary of Developer : "<>salary;
cout<<"Salary of Driver : "<<salary;
}
};
int main()
{
Developer D;
D.getSalary();
Driver w;
w.getSalary();
return 0;
}
#include
ReplyDeleteusing namespace std;
class Employee
{public:
virtual int getSalary()=0;
};
class Developer:public Employee
{
public:
int salary;
int getSalary()
{cin>>salary;
cout<<"Salary of Developer : "<>salary;
cout<<"\nSalary of Driver : "<<salary;
}
};
int main() {
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
Saab Fuddu ho, this is the 100% evaluating code :
ReplyDeleteThis comment has been removed by the author.
ReplyDelete#include
using namespace std;
class Employee
{public:
virtual int getSalary()=0;
};
class Developer:public Employee
{
public:
int salary;
int getSalary()
{cin>>salary;
cout<<"Salary of Developer : "<>salary;
//cout<<"Salary of Developer : "<<salary;
cout<<"Salary of Driver : "<<salary;}};
int main() {
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}
#include
ReplyDeleteusing namespace std;
class Employee
{
public:
virtual int getSalary()=0;
};
class Developer:public Employee
{
public:
int salary;
int getSalary()
{
cin>>salary;
cout<<"Salary of Developer : "<>salary;
cout<<"Salary of Driver : "<<salary;
}
};
int main()
{
Developer d;
d.getSalary();
Driver w;
w.getSalary();
return 0;
}