-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoanQualifier.java
More file actions
32 lines (23 loc) · 806 Bytes
/
Copy pathLoanQualifier.java
File metadata and controls
32 lines (23 loc) · 806 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
29
30
31
package exercises;
import java.util.Scanner;
public class LoanQualifier {
public static void main(String[] args) {
int requiredSalary = 30000;
int requiredYearsEmployed = 2;
System.out.println("Enter your salary:");
Scanner sc = new Scanner(System.in);
double salary = sc.nextDouble();
System.out.println("Enter the number of years with your current employer: ");
double years = sc.nextDouble();
sc.close();
if(salary >= requiredSalary) {
if(years >= requiredYearsEmployed) {
System.out.println("Congrats! You qualify for the loan");
} else {
System.out.println("Sorry, you must have worked ate your current job " + requiredYearsEmployed + " years");
}
} else {
System.out.println("Sorry, you must earn at least $ " + requiredSalary);
}
}
}