Qualifying for a Bank Loan
Decision structure inside decision structure:
Problem: To determine if a customer qualifies for a bank loan.
Requirements:
Create 2 constants
MIN_SALARY = 30000.0
MIN_YEARS = 2
To qualify for a bank loan, 2 conditions must be must exist:
The customer must earn at least $30,000 per year
The customer must have been employed for at least 2 years.
Use proper indentation and display appropriate message
Input: annual salary, years employed
Compute: does customer meet both qualifications for the loan?
Output: See examples: (input shown in bold)
Enter your annual salary: 35000
Enter the number of years employed: 1
You must have been employed for at least 2 years to qualify.
Enter your annual salary: 25000
Enter the number of years employed: 5
You must earn at least $30,000 per year to qualify.
Enter your annual salary: 35000
Enter the number of years employed: 5
You qualify for the loan. 1