Question: Ignore the wrong indentation, assume its correct Find the error(s) in the following code. For each question,firstexplain what each error is and then correct it.

Ignore the wrong indentation, assume its correct

Find the error(s) in the following code. For each question,firstexplain what each error is and then correct it.

Given the conditions stated below, assume that the rule for approving a loan application is as follows: Approve the loan only if both condition 1 and condition 2 are true and at least one of condition 3 and condition 4 are true.That is, for an applicant to get a loan approved, she must have a salary >= 85000 plus debt to income ratio <=0.36 plus she must either be a home owner or a college graduate

Condition 1: salary >= 85000

Condition 2: debttoincomeratio<=0.36

Condition 3: isGraduate = True

Condition 4: isHomeOwner = True

Then what is wrong with the following code? Explain the error(s) andrewrite the corrected code.

if salary >= 85000 anddebttoincomeratio<=0.36 andisGrad == True or isHomeOwner == True:

loan_approved = True

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!