Skip to content

Commit 43886bb

Browse files
committed
Completed Banking and Resort Programs
1 parent 3390d6b commit 43886bb

23 files changed

+313
-133
lines changed

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Banking/bankDatabase.txt

51 Bytes
Binary file not shown.

Banking/idthreshold.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,29 @@
1111
3
1212
1
1313
2
14+
3
15+
3
16+
4
17+
4
18+
4
19+
4
20+
4
21+
4
22+
4
23+
5
24+
5
25+
5
26+
5
27+
5
28+
5
29+
5
30+
5
31+
5
32+
5
33+
5
34+
5
35+
6
36+
6
37+
6
38+
6
39+
6

Banking/src/account.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void initialize() throws IOException, ClassNotFoundException {
4040
flag=false;
4141
}
4242
}
43-
transactionHistory="";
43+
transactionHistory="Action\t\tDebit\t\tCredit\t\tBalance\n";
4444
balance="0";
4545
}
4646
}

Banking/src/main.java

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static void main(String Args[]) throws IOException, ClassNotFoundExceptio
1717
try {
1818
f.init();
1919
}
20-
catch (java.io.EOFException e){
20+
catch (EOFException | StreamCorruptedException e){
2121
f.Database.Data[1]=new account();
2222
f.uploadChanges();
2323
f.init();
@@ -51,16 +51,16 @@ public static void main(String Args[]) throws IOException, ClassNotFoundExceptio
5151
}
5252
}
5353
}
54-
System.out.println("Welcome, "+ac.Name);
55-
System.out.println("____________________________________");
54+
System.out.println("Welcome, "+ac.Name+"________________________");
55+
//System.out.println("____________________________________________");
5656
System.out.println("What do you want to do ?");
57-
System.out.println("1:Withdraw\t\t2:Deposit\n3:Display Details");
57+
System.out.println("1:Withdraw\t\t2:Deposit\n" +
58+
"3:Display Details___________________________");
5859
System.out.print("Enter your selection :");
5960
int choice=in.nextInt();
6061
switch (choice){
6162
case 1:
62-
System.out.println("Deposit:");
63-
System.out.println("____________________________________");
63+
System.out.println("Withdraw:___________________________________");
6464
Scanner c1=new Scanner(System.in);
6565
System.out.print("Enter the Amount you want to withdraw :");
6666
String withdraw=c1.nextLine();
@@ -70,31 +70,43 @@ public static void main(String Args[]) throws IOException, ClassNotFoundExceptio
7070
}
7171
else{
7272
ac.balance=String.valueOf(Integer.valueOf(ac.balance)-Integer.valueOf(withdraw));
73+
if(withdraw.length()>=4){
74+
ac.transactionHistory=ac.transactionHistory+"Withdraw\t"+withdraw+"\t\t-----\t\t"+ac.balance+"\n";
75+
}
76+
else
77+
ac.transactionHistory=ac.transactionHistory+"Withdraw\t"+withdraw+"\t\t\t-----\t\t"+ac.balance+"\n";
7378
f.Database.Data[failsafe]=ac;
7479
f.uploadChanges();
7580
f.init();
81+
System.out.println("Remaining Balance\t:"+ac.balance);
7682
}
7783
break;
7884

7985
case 2:
8086
Scanner c2=new Scanner(System.in);
81-
System.out.println("Withdraw:");
82-
System.out.println("____________________________________");
87+
System.out.println("Deposit:____________________________________");
8388
System.out.print("Enter the Amount you want to Deposit :");
8489
String deposit=c2.nextLine();
8590
ac.balance=String.valueOf(Integer.valueOf(ac.balance)+Integer.valueOf(deposit));
91+
if(deposit.length()>=4) {
92+
ac.transactionHistory = ac.transactionHistory + "Deposit\t\t-----\t\t" + deposit + "\t\t" + ac.balance + "\n";
93+
}
94+
else
95+
ac.transactionHistory = ac.transactionHistory + "Deposit\t\t-----\t\t" + deposit + "\t\t\t" + ac.balance + "\n";
8696
f.Database.Data[failsafe]=ac;
8797
f.uploadChanges();
8898
f.init();
8999
System.out.println("Transaction Successful");
100+
System.out.println("Remaining Balance\t:"+ac.balance);
90101
break;
91102

92103
case 3:
93-
System.out.println("Account Details");
94-
System.out.println("____________________________________");
104+
System.out.println("Account Details_____________________________");
95105
System.out.println("Name\t:"+ac.Name);
96106
System.out.println("ID\t\t:"+ac.ID);
97107
System.out.println("Balance\t:"+ac.balance);
108+
System.out.println("Transaction History_________________________\n"+ac.transactionHistory);
109+
System.out.println("____________________________________________");
98110
}
99111
FileWriter fw = new FileWriter("idthreshold.txt",true);
100112
BufferedWriter bw=new BufferedWriter(fw);

Resort/Resort.iml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>

Resort/ResortDatabase.txt

9.02 KB
Binary file not shown.

Resort/aboutResort.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
About This Resort
2+
3+
The Poovath Heritage, Fort Kochi
4+
Relive the glorious past at The Poovath Heritage, a renovated colonial building from the colonial era. It stands by
5+
bewitching Arabian Sea in Fort Kochi on the south west coast of India. Fort Kochi also known as ‘Queen of the Arabian
6+
Sea’ is a laid back coastal town with a colonial past.
7+
8+
Vestiges of Portugese, Dutch, and British (in that order) colonialism lie scattered apart from the religious influences
9+
like synagogues, churches and so on. But long before them, the Arabs and the Chinese and even the Greeks traded with
10+
Kochi. So, it is aptly said to be the cultural crossroads. For those with a penchant for history, Poovath and the
11+
surroundings will have much to say.
12+
13+
The in-house restaurant brings the Cuisines of the World to one table. Relish delicacies as varied as North Indian,
14+
South Indian, Continental, Italian and more. Done to perfection by experienced cooks, the authentic recipes
15+
of the different regions.
16+
17+
Enjoy a dip in the private pool while the breeze from the Arabian Sea caresses you.

Resort/idThreshold.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
1
2+
2
3+
2
4+
2
5+
2
6+
2
7+
2

Resort/src/database.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import java.io.*;
2+
/**
3+
* Created by D'codex on January 2017.
4+
*/
5+
public class database implements Serializable{
6+
private static final long serialVersionUID = 1L;
7+
profile Data[];
8+
database(){
9+
Data=new profile[250];
10+
for (int i=0;i<250;i++){
11+
Data[i]=new profile();
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)