-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloanQualifier.java
More file actions
34 lines (22 loc) · 866 Bytes
/
loanQualifier.java
File metadata and controls
34 lines (22 loc) · 866 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
32
33
34
package chapter2;
import java.util.Scanner;
public class LoanQualifier {
public static void main(String [] args) {
Scanner scanner = new Scanner(System.in);
// 1. Values we know
int minSalary = 30000;
int minWorkingYear = 2;
// 2. Values we don't know
System.out.println("Please enter your minimum salary ");
int actualSalary = scanner.nextInt();
System.out.println("Please enter the number of year you have worked for ");
int yearWorking = scanner.nextInt();
scanner.close();
// 3. Tell who qualified
if(minSalary >= actualSalary && minWorkingYear >= yearWorking) {
System.out.println("Yay you qualified");
}else {
System.out.println("Sorry, you don't meet all the requirements. Try again next time.");
}
}
}