#include <iostream>
using namespace std;
int main()
{
string names[4];
int num[4];
int ghs=2500;
int ghs_d[4];
cout<<"\nEnter the names of four faculty members and number of times absent:\n";
for(int i=0;i<4;i++){
cin>>names[i];
cin>>num[i];
}
for(int i=0;i<4;i++){
if(num[i]==1)
ghs_d[i]=200;
if(num[i]==2)
ghs_d[i]=500;
if(num[i]==1)
ghs_d[i]=900;
if(num[i]==1)
ghs_d[i]=1400;
}
int total_ghs[4];
for(int i=0;i<4;i++){
total_ghs[i]=ghs-ghs_d[i];
}
for(int i=0;i<4;i++){
cout<<"\nName: "<<names[i]<<" salary: "<<total_ghs[i];
}
return 0;
}
Comments
Leave a comment