Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
project-Lab9
Project
Project
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
Amirhosein Rajabpour
project-Lab9
Commits
8a026070
Commit
8a026070
authored
May 12, 2019
by
Amirhosein Rajabpour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interface commit
parent
5f84f1ae
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
3 deletions
+31
-3
Account.java
src/org/university/core/Account.java
+11
-1
AccountingManagement.java
src/org/university/core/AccountingManagement.java
+12
-2
Professor.java
src/org/university/core/Professor.java
+4
-0
ServiceEmployee.java
src/org/university/core/ServiceEmployee.java
+4
-0
No files found.
src/org/university/core/Account.java
View file @
8a026070
...
@@ -3,11 +3,13 @@ package org.university.core;
...
@@ -3,11 +3,13 @@ package org.university.core;
public
class
Account
public
class
Account
{
{
private
AbstractEmployee
owner
;
private
AbstractEmployee
owner
;
private
double
credit
;
private
double
credit
=
0
;
private
double
demand
=
0
;
public
Account
(
AbstractEmployee
owner
,
double
credit
)
{
public
Account
(
AbstractEmployee
owner
,
double
credit
)
{
this
.
owner
=
owner
;
this
.
owner
=
owner
;
this
.
credit
=
credit
;
this
.
credit
=
credit
;
this
.
demand
=
0
;
}
}
public
AbstractEmployee
getOwner
()
{
public
AbstractEmployee
getOwner
()
{
...
@@ -25,4 +27,12 @@ public class Account
...
@@ -25,4 +27,12 @@ public class Account
public
void
setCredit
(
double
credit
)
{
public
void
setCredit
(
double
credit
)
{
this
.
credit
=
credit
;
this
.
credit
=
credit
;
}
}
public
double
getDemand
()
{
return
demand
;
}
public
void
setDemand
(
double
demand
)
{
this
.
demand
=
demand
;
}
}
}
\ No newline at end of file
src/org/university/core/AccountingManagement.java
View file @
8a026070
...
@@ -12,10 +12,10 @@ public class AccountingManagement
...
@@ -12,10 +12,10 @@ public class AccountingManagement
boolean
flag
=
true
;
boolean
flag
=
true
;
for
(
Account
account:
accounts
)
for
(
Account
account:
accounts
)
{
{
if
(
account
.
getOwner
()==
employee
)
if
(
account
.
getOwner
()==
employee
)
{
{
double
amount
=
employee
.
callCurrentIncome
();
double
amount
=
employee
.
callCurrentIncome
();
account
.
setCredit
(
account
.
getCredit
()
+
amount
);
account
.
setCredit
(
account
.
getCredit
()
+
amount
);
flag
=
false
;
flag
=
false
;
Statement
s
=
new
Statement
(
amount
,
employee
.
callEmployee
());
Statement
s
=
new
Statement
(
amount
,
employee
.
callEmployee
());
statements
.
add
(
s
);
statements
.
add
(
s
);
...
@@ -31,4 +31,14 @@ public class AccountingManagement
...
@@ -31,4 +31,14 @@ public class AccountingManagement
}
}
}
}
public
void
settle
(
AccountingInterface
employee
){
for
(
Account
account:
accounts
){
if
(
account
.
getOwner
()
==
employee
){
if
(
account
.
getDemand
()
>
0
){
account
.
setCredit
(
account
.
getCredit
()
+
account
.
getDemand
());
account
.
setDemand
(
0
);
}
}
}
}
}
}
src/org/university/core/Professor.java
View file @
8a026070
...
@@ -30,4 +30,8 @@ public class Professor extends AbstractEmployee
...
@@ -30,4 +30,8 @@ public class Professor extends AbstractEmployee
}
}
@Override
public
AbstractEmployee
callEmployee
()
{
return
null
;
}
}
}
src/org/university/core/ServiceEmployee.java
View file @
8a026070
...
@@ -24,6 +24,10 @@ public class ServiceEmployee extends AbstractEmployee
...
@@ -24,6 +24,10 @@ public class ServiceEmployee extends AbstractEmployee
else
else
return
false
;
return
false
;
}
}
@Override
public
AbstractEmployee
callEmployee
()
{
return
null
;
}
}
}
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