Skip to content

Commit d2d97c3

Browse files
initial commit
1 parent 4aa3bdc commit d2d97c3

3 files changed

Lines changed: 176 additions & 1 deletion

File tree

Collection/src/Hashset/common_element.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static void main(String[] args)
2424
new common_element();
2525
h1.add("Life") ;
2626
h1.add("My");
27-
h1.add("Pie");
27+
h1.add("Pie");
2828
System.out.println("Displaying HashSet h1"+h1);
2929
h2.add("My");
3030
h2.add("my");

FATANSWERKEY/src/Q1/Banksmain.java

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/**
2+
*
3+
*/
4+
package Q1;
5+
import java.util.*;
6+
/**
7+
* @author M.NAVEEN
8+
* RANDOM CODER'S
9+
* Tech/Project Lead Android Club
10+
*/
11+
public class Banksmain {
12+
13+
public static void main(String[] args)
14+
{
15+
16+
ICICIBank icc=new ICICIBank (123833383,"Naveen",4,5000,20);
17+
System.out.println("ACCOUNT NUMBER :"+icc.accountNumber+" Name :"+icc.customerName+" AMOUNT :"+icc.calculateAmount());
18+
19+
KotMBank kc=new KotMBank(54505151,"Rhea Sharma",5,5000,20);
20+
System.out.println("ACCOUNT NUMBER :"+kc.accountNumber+" Name :"+kc.customerName+" AMOUNT :"+kc.calculateAmount());
21+
}
22+
23+
}
24+
25+
26+
class ICICIBank extends GeneralBank
27+
{
28+
29+
public ICICIBank(long accountNumber, String customerName, float rateOfInterest, int pAmount, int noOfYears) {
30+
super(accountNumber, customerName);
31+
this.rateOfInterest = (rateOfInterest)/100f;
32+
this.pAmount = pAmount;
33+
this.noOfYears = noOfYears;
34+
}
35+
36+
private float rateOfInterest;
37+
38+
int pAmount, noOfYears;
39+
public void setRateOfInterest(float rateOfInterest) {
40+
this.rateOfInterest = rateOfInterest;
41+
}
42+
43+
public int getpAmount() {
44+
return pAmount;
45+
}
46+
public void setpAmount(int pAmount) {
47+
this.pAmount = pAmount;
48+
}
49+
public int getNoOfYears() {
50+
return noOfYears;
51+
}
52+
public void setNoOfYears(int noOfYears) {
53+
this.noOfYears = noOfYears;
54+
}
55+
56+
public double getInterestRate() { return (double)rateOfInterest ;}; //(Double ) not needed
57+
58+
public double calculateAmount() {
59+
pAmount=(int)(pAmount+(rateOfInterest*noOfYears*pAmount));
60+
return (pAmount);
61+
}
62+
63+
}
64+
65+
66+
67+
class KotMBank extends GeneralBank
68+
{
69+
70+
71+
72+
public KotMBank(long accountNumber, String customerName, float rateOfInterest, int pAmount, int noOfYears) {
73+
super(accountNumber, customerName);
74+
this.rateOfInterest = (rateOfInterest)/100f;
75+
this.pAmount = pAmount;
76+
this.noOfYears = noOfYears;
77+
}
78+
79+
private float rateOfInterest;
80+
81+
int pAmount, noOfYears;
82+
public void setRateOfInterest(float rateOfInterest) {
83+
this.rateOfInterest = rateOfInterest;
84+
}
85+
86+
public int getpAmount() {
87+
return pAmount;
88+
}
89+
public void setpAmount(int pAmount) {
90+
this.pAmount = pAmount;
91+
}
92+
public int getNoOfYears() {
93+
return noOfYears;
94+
}
95+
public void setNoOfYears(int noOfYears) {
96+
this.noOfYears = noOfYears;
97+
}
98+
99+
public double getInterestRate() { return (double)rateOfInterest ;}; //(Double ) not needed
100+
101+
public double calculateAmount() {
102+
103+
pAmount=(int)(pAmount+(rateOfInterest*noOfYears*pAmount));
104+
return pAmount;
105+
}
106+
107+
}
108+
109+
110+
abstract class GeneralBank
111+
{
112+
long accountNumber;
113+
String customerName;
114+
115+
public long getAccountNumber() {
116+
return accountNumber;
117+
}
118+
public void setAccountNumber(long accountNumber) {
119+
this.accountNumber = accountNumber;
120+
}
121+
public String getCustomerName() {
122+
return customerName;
123+
}
124+
public void setCustomerName(String customerName) {
125+
this.customerName = customerName;
126+
}
127+
public GeneralBank(long accountNumber, String customerName) {
128+
129+
this.accountNumber = accountNumber;
130+
this.customerName = customerName;
131+
}
132+
133+
abstract public double calculateAmount();
134+
135+
}
136+
137+
138+
139+
140+
141+
142+
143+
144+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
*
3+
*/
4+
package in.exam.service;
5+
import java.util.*;
6+
import in.exam.ice.*;
7+
import in.exam.util.IceCreamFlavorException;
8+
import in.exam.util.IceCreamScoopException;
9+
/**
10+
* @author M.NAVEEN
11+
* RANDOM CODER'S
12+
* Tech/Project Lead Android Club
13+
*/
14+
public class Administrator {
15+
16+
public static void main(String[] args) {
17+
18+
IceCream c1=new IceCream();
19+
try {
20+
c1.getIceCream();
21+
} catch (IceCreamFlavorException e) {
22+
23+
System.out.println(e);
24+
} catch (IceCreamScoopException e) {
25+
System.out.println(e);
26+
}
27+
28+
}
29+
30+
}
31+

0 commit comments

Comments
 (0)