Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
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
9731088
lab9
Commits
64450784
Commit
64450784
authored
May 12, 2019
by
Roham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Second
parent
7206aba8
Pipeline
#587
failed with stages
Changes
5
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
1 deletion
+61
-1
Account.java
src/org/university/core/Account.java
+23
-0
AccountingManagement.java
src/org/university/core/AccountingManagement.java
+30
-0
Employee.java
src/org/university/core/Employee.java
+5
-0
Professor.java
src/org/university/core/Professor.java
+1
-0
ServiceEmployee.java
src/org/university/core/ServiceEmployee.java
+2
-1
No files found.
src/org/university/core/Account.java
0 → 100644
View file @
64450784
package
org
.
university
.
core
;
public
class
Account
{
private
Employee
employee
;
private
int
balance
;
public
Account
(
Employee
employee
)
{
this
.
employee
=
employee
;
balance
=
0
;
}
public
void
checkout
(
double
income
){
balance
+=
income
;
}
public
Employee
getEmployee
()
{
return
employee
;
}
public
double
getBalance
()
{
return
balance
;
}
}
src/org/university/core/AccountingManagement.java
0 → 100644
View file @
64450784
package
org
.
university
.
core
;
import
java.util.ArrayList
;
public
class
AccountingManagement
{
private
ArrayList
<
Account
>
accounts
;
private
ArrayList
<
Statement
>
transactions
;
public
AccountingManagement
()
{
this
.
accounts
=
new
ArrayList
<>();
this
.
transactions
=
new
ArrayList
<>();
}
public
void
addAccount
(
Account
account
)
{
this
.
accounts
.
add
(
account
);
}
public
void
settle
()
{
for
(
int
i
=
0
;
i
<
accounts
.
size
();
i
++)
{
accounts
.
get
(
i
).
checkout
(
accounts
.
get
(
i
).
getEmployee
().
calCurrentIncome
()
+
accounts
.
get
(
i
).
getEmployee
().
getBasicIncome
());
transactions
.
add
(
new
Statement
(
accounts
.
get
(
i
).
getEmployee
().
calCurrentIncome
()
+
accounts
.
get
(
i
).
getEmployee
().
getBasicIncome
()
,
accounts
.
get
(
i
).
getEmployee
()));
}
}
public
ArrayList
<
Statement
>
getTransactions
()
{
return
transactions
;
}
}
src/org/university/core/Employee.java
View file @
64450784
...
...
@@ -6,6 +6,7 @@ public abstract class Employee extends Person {
protected
ArrayList
<
Statement
>
bankStatements
;
protected
String
position
;
protected
double
basicIncome
;
protected
double
requiredIncome
;
public
Employee
(
String
firstName
,
String
lastName
,
String
id
,
int
joiningYear
,
Department
department
,
String
position
,
double
basicIncome
)
{
super
(
firstName
,
lastName
,
id
,
joiningYear
,
department
);
...
...
@@ -31,6 +32,10 @@ public abstract class Employee extends Person {
this
.
basicIncome
=
basicIncome
;
}
public
double
getBasicIncome
()
{
return
basicIncome
;
}
public
abstract
double
calCurrentIncome
();
public
abstract
Boolean
isPromotable
();
}
src/org/university/core/Professor.java
View file @
64450784
...
...
@@ -31,6 +31,7 @@ public class Professor extends Employee{
public
double
calCurrentIncome
()
{
return
requiredIncome
;
}
public
Boolean
isPromotable
()
...
...
src/org/university/core/ServiceEmployee.java
View file @
64450784
...
...
@@ -6,9 +6,10 @@ public class ServiceEmployee extends Employee{
}
public
double
calCurrentIncome
()
{
return
requiredIncome
;
}
public
Boolean
isPromotable
()
{
}
}
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