Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Activity 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
daniel.pearson
Activity 3
Commits
a9ea10ca
Commit
a9ea10ca
authored
May 15, 2022
by
Daniel Pearson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Origin
parent
398b66fa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
BankAccount.class
bin/BankAccount.class
+0
-0
savingsAccount.class
bin/savingsAccount.class
+0
-0
BankAccount.java
src/BankAccount.java
+6
-6
No files found.
bin/BankAccount.class
View file @
a9ea10ca
No preview for this file type
bin/savingsAccount.class
View file @
a9ea10ca
No preview for this file type
src/BankAccount.java
View file @
a9ea10ca
...
...
@@ -4,7 +4,7 @@ public class BankAccount {
int
accountNumber
;
String
name
;
float
balance
;
static
Scanner
myObj
=
new
Scanner
(
System
.
in
);
static
Scanner
user
=
new
Scanner
(
System
.
in
);
//make it so it checks if the money is available in the account
public
BankAccount
(
int
accountNumber
,
String
name
,
float
balance
){
...
...
@@ -26,7 +26,7 @@ public class BankAccount {
public
static
void
deposit
(
BankAccount
amount
){
System
.
out
.
println
(
"\n"
+
"\n"
+
"How much would you like to deposit? "
);
float
depositAmount
;
depositAmount
=
myObj
.
nextFloat
();
depositAmount
=
user
.
nextFloat
();
amount
.
balance
+=
depositAmount
;
System
.
out
.
println
(
"Your total bank balance is: "
+
"£"
+
amount
.
balance
);
...
...
@@ -36,7 +36,7 @@ public class BankAccount {
public
static
void
withdrawal
(
BankAccount
amount
){
System
.
out
.
println
(
"\n"
+
"\n"
+
"How much would you like to withdraw? "
);
float
withdrawAmount
;
withdrawAmount
=
myObj
.
nextFloat
();
withdrawAmount
=
user
.
nextFloat
();
if
(
withdrawAmount
<
amount
.
balance
)
{
amount
.
balance
-=
withdrawAmount
;
...
...
@@ -77,13 +77,13 @@ class savingsAccount extends BankAccount{
savingsWithdrawal
(
dan
);
savingsBankFees
(
dan
);
savingsDisplay
(
dan
);
Scanner
myObj1
=
new
Scanner
(
System
.
in
);
Scanner
user
=
new
Scanner
(
System
.
in
);
}
public
static
void
savingsDeposit
(
BankAccount
amount
){
System
.
out
.
println
(
"\n"
+
"\n"
+
"How much would you like to deposit? "
);
float
depositAmount
;
depositAmount
=
myObj
.
nextFloat
();
depositAmount
=
user
.
nextFloat
();
amount
.
balance
+=
depositAmount
;
System
.
out
.
println
(
"Your total bank balance is: "
+
"£"
+
amount
.
balance
);
...
...
@@ -93,7 +93,7 @@ class savingsAccount extends BankAccount{
public
static
void
savingsWithdrawal
(
BankAccount
amount
){
System
.
out
.
println
(
"\n"
+
"\n"
+
"How much would you like to withdraw? "
);
float
withdrawAmount
;
withdrawAmount
=
myObj
.
nextFloat
();
withdrawAmount
=
user
.
nextFloat
();
if
(
withdrawAmount
<=
100.0
){
if
(
withdrawAmount
<
amount
.
balance
)
{
amount
.
balance
-=
withdrawAmount
;
...
...
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