Program to calculate gross salary of a person | Function to calculate the salary of the person ; Condition to compute the allowance for the person ; Calculate gross salary ; Driver code ; Function call
function computeSalary ( basic , grade ) { let allowance ; let hra , da , pf ; hra = 0.2 * basic ; da = 0.5 * basic ; pf = 0.11 * basic ; if ( grade == ' ' ) { allowance = 1700.0 ; } else if ( grade == ' ' ) { allowance = 1500.0 ; } else { allowance = 1300.0 ; } let gross ; gross = Math . round ( basic + hra + da + allowance - pf ) ; return gross ; } let basic = 10000 ; let grade = ' ' ; document . write ( computeSalary ( basic , grade ) ) ;