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
def computeSalary ( basic , grade ) : NEW_LINE INDENT hra = 0.2 * basic NEW_LINE da = 0.5 * basic NEW_LINE pf = 0.11 * basic NEW_LINE if grade == ' A ' : NEW_LINE INDENT allowance = 1700.0 NEW_LINE DEDENT elif grade == ' B ' : NEW_LINE INDENT allowance = 1500.0 NEW_LINE DEDENT else : NEW_LINE INDENT allowance = 1300.0 ; NEW_LINE DEDENT gross = round ( basic + hra + da + allowance - pf ) NEW_LINE return gross NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT basic = 10000 NEW_LINE grade = ' A ' NEW_LINE print ( computeSalary ( basic , grade ) ) ; NEW_LINE DEDENT