Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
Java 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
elliot.copeland
Java Exercise 3
Commits
dee4d9c0
Commit
dee4d9c0
authored
May 12, 2022
by
elliot.copeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exercise Complete
parent
e30b71c1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
1 deletion
+10
-1
App.class
JavaAssessment 3/src/App.class
+0
-0
App.java
JavaAssessment 3/src/App.java
+4
-0
BankAccount.class
JavaAssessment 3/src/BankAccount.class
+0
-0
BankAccount.java
JavaAssessment 3/src/BankAccount.java
+4
-0
SavingAccount.class
JavaAssessment 3/src/SavingAccount.class
+0
-0
SavingAccount.java
JavaAssessment 3/src/SavingAccount.java
+2
-1
No files found.
JavaAssessment 3/src/App.class
View file @
dee4d9c0
No preview for this file type
JavaAssessment 3/src/App.java
View file @
dee4d9c0
...
...
@@ -19,8 +19,11 @@ public class App {
test
.
addOverdraft
(
500
);
test
.
withdrawal
(
800
);
test
.
display
();
test
.
accrueIntrest
();
System
.
out
.
println
(
" "
);
System
.
out
.
println
(
"~~~~~~~~~~~~~~~~~~Testing savings account~~~~~~~~~~~~~~~~~~~~~~"
);
BankAccount
test2
=
new
SavingAccount
(
900
,
"Bob"
,
100
);
test2
.
display
();
...
...
@@ -35,6 +38,7 @@ public class App {
System
.
out
.
println
(
" "
);
test2
.
bankFees
();
test2
.
accrueIntrest
();
test2
.
display
();
System
.
out
.
println
(
" "
);
...
...
JavaAssessment 3/src/BankAccount.class
View file @
dee4d9c0
No preview for this file type
JavaAssessment 3/src/BankAccount.java
View file @
dee4d9c0
...
...
@@ -38,4 +38,8 @@ public class BankAccount {
public
void
addOverdraft
(
float
od
)
{
overdraft
=
od
;
}
public
void
accrueIntrest
()
{
System
.
out
.
println
(
"A standard account cannot accrue intrest."
);
}
}
JavaAssessment 3/src/SavingAccount.class
View file @
dee4d9c0
No preview for this file type
JavaAssessment 3/src/SavingAccount.java
View file @
dee4d9c0
...
...
@@ -4,8 +4,9 @@ public class SavingAccount extends BankAccount {
super
(
accountnumber
,
uname
,
cbalance
);
}
@Override
public
void
accrueIntrest
()
{
balance
+=
(
balance
+
(
balance
*
0.05f
)
);
balance
+=
(
balance
*
0.05f
);
}
@Override
...
...
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