MENU
Question -

.Write the definition of a function FixPay (float Pay[ ], int N) in C+ + , which should modify each element of the array Pay having N elements, as per the following rules :

Existing Salary Value

Required Modification in Value

If less than 1,00,000

Add 25% in the existing value

If >=1,00,000 and <20,000

Add 20% in the existing value

If >=2,00,000

Add 15% in the existing value



Answer -

Void FixPay(float Pay[],int N)
{
for(int i=0;i
{
if(Pay[i]<100000)
Pay[i]+= Pay[i]*0.25;
else if(Pay[i]<200000)
Pay[i]+= Pay[i]*0.20;┬а
else
Pay[i]+= Pay[i]*0.15 ;
┬а}
}

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
×