the static data member and member function:
#include<iostream.h>
class salary
{
public:
void calc_bonus(double perc)
{your_bonus=b_sal*perc;}
static void reset_all(int p )
{all_bonus=p;}
int comp_tot()
{return(b_sal+your_bonus+all_bonus);}
salary(int a,int b)
{
b_sal=a;your_bonus=<<endl;
cout<<"constructor"<<endl;
}
~salary()
{
cout<<"dest"<<endl;
}
private:
int b_sal;
int your_bonus;
static int all_bonus;
};
int salary::all_bonus=100;
void main()
{
salary w1(105,75),w2(111,16);
w1.calc_bonus(0.2);
w2.calc_bonus(0.15);
salary::reset_all(400);
cout<<"w1"<<w1.comp_tot()<<"w2"<<w2.comp_tot()<<endl;
}
rewrite the above code and notice the output
لو سمحتم ممكن حل هذا البرنامج .. لاهنتم بليييييييييييييييز

