#include <iostream>
using namespace std;
class Salary
{
public:
int Increment(int currsal)
{
cin>>currsal;
}
int Increment(int currsal, int bonus)
{
return currsal+bonus;
}
};
int main()
{
int currsal,x,bonus;
cin>>currsal>>x>>bonus;
Salary ob;
ob.Increment(currsal);
cout<<x<<endl;
cout<<ob.Increment(currsal,bonus)<<endl;
return 0;
}
using namespace std;
class Salary
{
public:
int Increment(int currsal)
{
cin>>currsal;
}
int Increment(int currsal, int bonus)
{
return currsal+bonus;
}
};
int main()
{
int currsal,x,bonus;
cin>>currsal>>x>>bonus;
Salary ob;
ob.Increment(currsal);
cout<<x<<endl;
cout<<ob.Increment(currsal,bonus)<<endl;
return 0;
}
This comment has been removed by the author.
ReplyDeleteonly 33% success
ReplyDeleteit is not the right code.
ReplyDeletecompile time error
ReplyDelete#include
ReplyDeleteusing namespace std;
class Salary
{
public:
int Increment(int currsal)
{
return currsal;
}
int Increment(int currsal,int bonus)
{
int c;
c = currsal+bonus;
return c;
}
};
int main()
{
int currsal,bonus;
cin>>currsal>>bonus;
Salary ob;
//cout<<currsal<<endl<<(currsal+bonus);
cout<<ob.Increment(currsal)<<endl;
// cout<<x<<endl;
cout<<ob.Increment(currsal,bonus)<<endl;
return 0;
}
what is x used for in this code
ReplyDeleteto refer to your ex whose use you still dont know in life's code
ReplyDeleteit is not the right code.
ReplyDelete#include
ReplyDeleteusing namespace std;
class salary
{
public:
int increment(int currsal)
{
cin>>currsal;
}
int increment(int currsal,int bonus)
{
return currsal+bonus;
}
};
int main() {
int currsal,x,bonus;
cin>>currsal>>x>>bonus;
salary ob;
ob.increment(currsal);
cout<<ob.increment(currsal,bonus)<<endl;
cout<<x+currsal<<endl;
return 0;
}
nice work its working
Deleteit will work 100%
ReplyDeletebro these are not correct codes bro
ReplyDeleteplease upload another one
#include
ReplyDeleteusing namespace std;
class Salary
{
public:
int Increment(int currsal)
{
return currsal;
}
int Increment(int currsal,int bonus)
{
int c;
c = currsal+bonus;
return c;
}
};
int main()
{
int currsal,bonus;
cin>>currsal>>bonus;
Salary ob;
cout<<ob.Increment(currsal)<<endl;
cout<<ob.Increment(currsal,bonus)<<endl;
return 0;
}
#include //add iostream here
ReplyDeleteusing namespace std;
class Salary
{
public:
int Increment(int currsal)
{
cin>>currsal;
return currsal;
}
int Increment(int currsal, int bonus)
{
cin>>bonus;
return currsal+bonus;
}
};
class testclass
{
public:
testclass()
{
Salary ob;
int sal,bon;
sal=ob.Increment(sal);
cout<<sal<<endl;
cout<<ob.Increment(sal,bon);
}
};
int main()
{
testclass t;
return 0;
}
works 100%
Deleteonly 88%
Delete