Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
alx_java1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Patryk Czarnik
alx_java1
Commits
425a6644
Commit
425a6644
authored
Aug 06, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Poprawka w messedżach
parent
461613aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Konto.java
src/main/java/p09_klasy/Konto.java
+4
-4
No files found.
src/main/java/p09_klasy/Konto.java
View file @
425a6644
...
@@ -7,7 +7,7 @@ public class Konto {
...
@@ -7,7 +7,7 @@ public class Konto {
public
Konto
(
int
numer
,
int
saldo
,
Osoba
wlasciciel
)
{
public
Konto
(
int
numer
,
int
saldo
,
Osoba
wlasciciel
)
{
if
(
saldo
<
0
)
{
if
(
saldo
<
0
)
{
throw
new
IllegalArgumentException
(
"
u
jemne saldo w konstruktorze"
);
throw
new
IllegalArgumentException
(
"
U
jemne saldo w konstruktorze"
);
}
}
this
.
numer
=
numer
;
this
.
numer
=
numer
;
this
.
saldo
=
saldo
;
this
.
saldo
=
saldo
;
...
@@ -51,17 +51,17 @@ public class Konto {
...
@@ -51,17 +51,17 @@ public class Konto {
public
void
wplata
(
int
kwota
)
{
public
void
wplata
(
int
kwota
)
{
if
(
kwota
<=
0
)
{
if
(
kwota
<=
0
)
{
throw
new
IllegalArgumentException
(
"
niedodatnia kwota we wpłacie
"
);
throw
new
IllegalArgumentException
(
"
Niedodatnia kwota w metodzie wplata
"
);
}
}
saldo
+=
kwota
;
saldo
+=
kwota
;
}
}
public
void
wyplata
(
int
kwota
)
throws
BrakSrodkow
{
public
void
wyplata
(
int
kwota
)
throws
BrakSrodkow
{
if
(
kwota
<=
0
)
{
if
(
kwota
<=
0
)
{
throw
new
IllegalArgumentException
(
"
niedodatnia kwota w wypłacie
"
);
throw
new
IllegalArgumentException
(
"
Niedodatnia kwota w metodzie wyplata
"
);
}
}
if
(
kwota
>
saldo
)
{
if
(
kwota
>
saldo
)
{
throw
new
BrakSrodkow
(
"
z
a mało kasy na koncie nr "
+
numer
);
throw
new
BrakSrodkow
(
"
Z
a mało kasy na koncie nr "
+
numer
);
}
}
saldo
-=
kwota
;
saldo
-=
kwota
;
}
}
...
...
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