In: Computer Science
In your python program, ask the user to enter the annual income of an employee and the years of experience. Pass these data to a function. The function decides if an employee does qualify for a loan or does not, then it prints a message based on the following rules:
If the income is equal or greater than $40000, the function checks if the employee’s years of experience is greater than 4, if so the employee gets $6000 loan; otherwise, the amount of the loan will be $3500. However, if the income is less than $40000, the employee does not qualify for a loan.
--define the function here ---
income,exp = input("\nEnter the income and years of experience: ").split()
theIncome = float(income)
theExp = float(exp)
--- validate the inputs before passing them ---
loan(theIncome, theExp)
code:
output :
raw_code :
def loan(theIncome,theExp):
#checking given condition and printing message
if(theIncome>=40000):
if(theExp>4):
print('Qualified with $6000 loan')
else:
print('Qualified with $3500 loan')
else:
print('Does not qualified for a loan')
#taking input
income,exp = input("\nEnter the income and years of experience:
").split()
theIncome = float(income)
theExp = float(exp)
loan(theIncome,theExp) #calling function
****do commment for queries and rate me up*****