-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoan Approval.java
More file actions
28 lines (22 loc) · 1020 Bytes
/
Loan Approval.java
File metadata and controls
28 lines (22 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.Scanner; // Importing Scanner class for user input
// A program to determine loan approval based on credit score and salary
class Main {
public static void main(String[] args) {
// Create a Scanner object to read input
Scanner s = new Scanner(System.in);
// Prompt user to enter the credit score
System.out.println("Enter the credit score:");
int n = s.nextInt(); // Store the input in a variable
// Prompt user to enter the salary
System.out.println("Enter the Salary:");
int m = s.nextInt(); // Store the input in a variable
// Decision logic to check eligibility for loan approval
if (n >= 600 && m >= 40000) {
System.out.println("LOAN APPROVED"); // Print approval message if conditions are met
} else {
System.out.println("LOAN DENIED"); // Print denial message if conditions are not met
}
// Close the scanner to avoid memory leaks
s.close();
}
}