-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoopAssignment5.java
More file actions
54 lines (42 loc) · 2.79 KB
/
Copy pathLoopAssignment5.java
File metadata and controls
54 lines (42 loc) · 2.79 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package java_core;
public class LoopAssignment5 {
void loanAmountCalci(int accNo, int salary, int accBalance, String loanType, int expectedAmount, int expectedEmis){
if (accNo<=1999 && accNo>=1000){
if(accBalance>=1000){
if (loanType.equalsIgnoreCase("Car")){
if(salary >25000){
if(expectedAmount<=500000){
if(expectedEmis<=36){
System.out.println("Congrats! you are eligible for 500000 Rs loan amount\n Eligible emi's = 36");
}else{System.out.println("Maximum 36 emi's are allowed for Car loans");}
}else{System.out.println("Expected loan amount exceeds the maximum limit of 500000 for car loans");}
}else{System.out.println("We are sorry :( Car Loans are eligible for employees with salary more than 25000");}
}
else if (loanType.equalsIgnoreCase("house")){
if(salary >50000){
if(expectedAmount<=6000000){
if(expectedEmis<=60){
System.out.println("Congrats! you are eligible for 6000000 Rs loan amount\n Eligible emi's = 60");
}else{System.out.println("Maximum 60 emi's are allowed for House loans");}
}else{System.out.println("Expected loan amount exceeds the maximum limit of 6000000 for House loans");}
}else{System.out.println("We are sorry :( House Loans are eligible for employees with salary more than 500000");}
}
else if(loanType.equalsIgnoreCase("business")){
if(salary >75000){
if(expectedAmount<=7500000){
if(expectedEmis<=84){
System.out.println("Congrats! you are eligible for 7500000 Rs loan amount\n Eligible emi's = 84");
}else{System.out.println("Maximum 84 emi's are allowed for business loans");}
}else{System.out.println("Expected loan amount exceeds the maximum limit of 7500000 for business loans");}
}else{System.out.println("We are sorry :( Business Loans are eligible for employees with salary more than 75000");}
}
else {System.out.println("Invalid loan type! Kindly type between - Car, House & Business loan");}
}else{System.out.println("Not sufficient account balance");}
}
else{System.out.println("Wrong account number");}
}
public static void main(String args[]){
LoopAssignment5 object1 = new LoopAssignment5();
object1.loanAmountCalci(1001, 40000, 1000, "CAR", 300000, 100);
}
}