forked from Kaustubh72/Hackkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.java
More file actions
135 lines (134 loc) · 4.2 KB
/
interface.java
File metadata and controls
135 lines (134 loc) · 4.2 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import java.util.*;
/Importing Files/
interface CreditCardAPP
{
void getPersonalDetails();
void calculatePerYearIncome();
void printEligibility();
}
class ICIC implements CreditCardAPP
{
String name,mob,address,nominee,age,email;
double grossSal,netSal,perYearIncome,EMI;
public void getPersonalDetails()
{
Scanner in=new Scanner(System.in);
System.out.println("Enter name,mob,address,nominee,age and email of the customer");
name=in.nextLine();
mob=in.nextLine();
address=in.nextLine();
nominee=in.nextLine();
age=in.nextLine();
email=in.nextLine();
}
public void calculatePerYearIncome()
{
Scanner in=new Scanner(System.in);
System.out.println("Enter gross salary");
grossSal=in.nextDouble();
netSal=grossSal-(0.2*grossSal);
perYearIncome=netSal*12;
}
public void printEligibility()
{
Scanner in=new Scanner(System.in);
System.out.println("Enter EMI paid per month");
EMI=in.nextDouble();
if(EMI==0)
System.out.println("Eligibility score is: 3");
else if(EMI<(0.2*perYearIncome))
System.out.println("Eligibility score is: 2");
else if(EMI<(0.4*perYearIncome))
System.out.println("Eligibility score is: 1");
else if(EMI<(0.6*perYearIncome))
System.out.println("Eligibility score is: 0");
}
}
class HDFC implements CreditCardAPP
{
String name,mob,address,nominee,age,email;
double grossSal,netSal,perYearIncome,EMI;
public void getPersonalDetails()
{
Scanner in=new Scanner(System.in);
System.out.println("Enter name,mob,address,nominee,age and email of the customer");
name=in.nextLine();
mob=in.nextLine();
address=in.nextLine();
nominee=in.nextLine();
age=in.nextLine();
email=in.nextLine();
}
public void calculatePerYearIncome()
{
Scanner in=new Scanner(System.in);
System.out.println("Enter gross salary");
grossSal=in.nextDouble();
netSal=grossSal-(0.2*grossSal);
perYearIncome=netSal*12;
}
public void printEligibility()
{
Scanner in=new Scanner(System.in);
System.out.println("Enter EMI paid per month");
EMI=in.nextDouble();
if(EMI==0)
System.out.println("Eligibility score is: 3");
else if(EMI<(0.2*perYearIncome))
System.out.println("Eligibility score is: 2");
else if(EMI<(0.4*perYearIncome))
System.out.println("Eligibility score is: 1");
else if(EMI<(0.6*perYearIncome))
System.out.println("Eligibility score is: 0");
}
}
class AXIS implements CreditCardAPP
{
String name,mob,address,nominee,age,email;
double grossSal,netSal,perYearIncome,EMI;
public void getPersonalDetails()
{
Scanner in=new Scanner(System.in);
System.out.println("Enter name,mob,address,nominee,age and email of the customer");
name=in.nextLine();
mob=in.nextLine();
address=in.nextLine();
nominee=in.nextLine();
age=in.nextLine();
email=in.nextLine();
}
public void calculatePerYearIncome()
{
Scanner in=new Scanner(System.in);
System.out.println("Enter gross salary");
grossSal=in.nextDouble();
netSal=grossSal-(0.2*grossSal);
perYearIncome=netSal*12;
}
public void printEligibility()
{
Scanner in=new Scanner(System.in);
System.out.println("Enter EMI paid per month");
EMI=in.nextDouble();
if(EMI==0)
System.out.println("Eligibility score is: 3");
else if(EMI<(0.2*perYearIncome))
System.out.println("Eligibility score is: 2");
else if(EMI<(0.4*perYearIncome))
System.out.println("Eligibility score is: 1");
else if(EMI<(0.6*perYearIncome))
System.out.println("Eligibility score is: 0");
}
}
class testInterfaces
{
public static void main(String[] args)
{
CreditCardAPP ic=new ICICI();
CreditCardAPP hd=new HDFC();
CreditCardAPP ax=new AXIS();
ic.getPersonalDetails();
ic.calculatePerYearIncome();
ic.printEligibility();
}
}