Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Ex3_Bank
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tahsif.ahmed
Ex3_Bank
Commits
173e2c62
Commit
173e2c62
authored
May 05, 2022
by
tahsif.ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
8f9533ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
Main.java
Main.java
+62
-0
No files found.
Main.java
0 → 100644
View file @
173e2c62
public
class
Main
{
public
static
void
main
(
String
[]
args
){
bankaccount
bank
=
new
bankaccount
(
92910
,
"Tahsif"
,
200.00
,
false
);
bank
.
balance
=
widthdrawal
(
bank
.
balance
,
150
,
bank
.
isSaving
);
bank
.
balance
=
bankFees
(
bank
.
balance
,
bank
.
isSaving
);
bank
.
balance
=
accureInterest
(
bank
.
balance
,
bank
.
isSaving
);
/*display(bank.accountNumber, bank.name, bank.balance);*/
}
public
double
deposit
(
double
a
,
double
b
){
a
=
a
+
b
;
System
.
out
.
println
(
"You have deopsited: "
+
b
+
" You now have: "
+
a
);
return
a
;
}
public
static
double
widthdrawal
(
double
a
,
double
b
,
boolean
isSaving
){
if
(
isSaving
==
true
&&
b
>
100
){
System
.
out
.
println
(
"You cannot widthdraw more than £100"
);
}
else
{
a
=
a
-
b
;
System
.
out
.
println
(
"You have widthdrew: "
+
b
+
" You now have: "
+
a
);
return
a
;
}
return
a
;
}
public
static
double
bankFees
(
double
a
,
boolean
isSaving
){
if
(
isSaving
==
true
){
System
.
out
.
println
(
"You do not accrue bank fees with a saving account"
);
}
else
{
a
=
a
*
0.95
;
System
.
out
.
println
(
"You have to pay a bank fee of 5%. You have: "
+
a
);
}
return
a
;
}
public
static
double
accureInterest
(
double
balance
,
boolean
isSaving
){
if
(
isSaving
==
true
){
balance
=
balance
*
1.05
;
System
.
out
.
println
(
"You have accurued interest of 5%, You now have: "
+
balance
);
return
balance
;
}
return
balance
;
}
public
static
void
display
(
int
acnum
,
String
name
,
double
balance
){
System
.
out
.
println
(
"Account number: "
+
acnum
);
System
.
out
.
println
(
"Name: "
+
name
);
System
.
out
.
println
(
"Balance: "
+
balance
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment