Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Exercise 3
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
henry.ewen
Exercise 3
Commits
23bb95f9
Commit
23bb95f9
authored
May 15, 2022
by
Henry Ewen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished
parent
c29efefd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
0 deletions
+91
-0
BankAccount.java
BankAccount.java
+55
-0
SavingAccount.java
SavingAccount.java
+36
-0
No files found.
BankAccount.java
0 → 100644
View file @
23bb95f9
public
class
BankAccount
{
public
int
accountNumber
;
public
String
name
;
public
double
balance
;
public
double
overdraft
;
BankAccount
(
int
x
,
String
y
,
double
z
)
{
accountNumber
=
x
;
name
=
y
;
balance
=
z
;
overdraft
=
0
;
}
public
void
desposit
(
int
i
)
{
balance
=
i
+
balance
;
}
public
double
display
()
{
return
balance
;
}
public
void
setbal
(
int
i
)
{
balance
=
i
;
}
public
void
withdrawl
(
int
i
)
{
double
temp
=
this
.
balance
-
i
;
if
(
this
.
overdraft
<
0
)
{
if
(
temp
>
this
.
overdraft
)
{
this
.
balance
=
this
.
balance
-
i
;
}
}
else
{
this
.
balance
=
this
.
balance
-
i
;
}
}
public
void
bankFees
()
{
double
temp
=
0.05
*
this
.
balance
;
this
.
balance
=
this
.
balance
-
temp
;
}
public
void
addOverdraft
(
int
x
)
{
x
=
0
-
x
;
this
.
overdraft
=
x
;
}
public
double
thisover
()
{
return
overdraft
;
}
}
SavingAccount.java
0 → 100644
View file @
23bb95f9
public
class
SavingAccount
{
public
int
accountNumber
;
public
String
name
;
public
double
balance
;
SavingAccount
()
{}
SavingAccount
(
int
x
,
String
y
,
double
z
)
{
accountNumber
=
x
;
name
=
y
;
balance
=
z
;
}
public
void
desposit
(
int
i
)
{
balance
=
i
+
balance
;
}
public
double
display
()
{
return
balance
;
}
public
void
setbal
(
int
i
)
{
balance
=
i
;
}
public
void
withdrawl
(
int
i
)
{
if
(
i
!=
100
)
{
balance
=
balance
-
i
;}
}
public
void
accrueInterest
()
{
double
temp
=
0.05
*
this
.
balance
;
this
.
balance
=
this
.
balance
+
temp
;
}
}
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