Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
EmployeePayroll
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kishore.glitz
EmployeePayroll
Commits
dd888bc9
Commit
dd888bc9
authored
Jan 20, 2023
by
kishore.glitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
completed
parent
7cc5e7d3
Pipeline
#2468
failed with stages
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
231 additions
and
1 deletion
+231
-1
.classpath
.classpath
+32
-0
.gitignore
.gitignore
+1
-0
.project
.project
+23
-0
org.eclipse.core.resources.prefs
.settings/org.eclipse.core.resources.prefs
+5
-0
org.eclipse.jdt.core.prefs
.settings/org.eclipse.jdt.core.prefs
+9
-0
org.eclipse.m2e.core.prefs
.settings/org.eclipse.m2e.core.prefs
+4
-0
Application.java
src/main/java/com/altimetrik/Application.java
+7
-1
AccountantFirm.java
src/main/java/com/altimetrik/demo/model/AccountantFirm.java
+24
-0
Company.java
src/main/java/com/altimetrik/demo/model/Company.java
+12
-0
EngineerFirm.java
src/main/java/com/altimetrik/demo/model/EngineerFirm.java
+80
-0
Solution.java
src/main/java/com/altimetrik/demo/model/Solution.java
+34
-0
No files found.
.classpath
0 → 100644
View file @
dd888bc9
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
kind=
"src"
output=
"target/classes"
path=
"src/main/java"
>
<attributes>
<attribute
name=
"optional"
value=
"true"
/>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
excluding=
"**"
kind=
"src"
output=
"target/classes"
path=
"src/main/resources"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"src"
output=
"target/test-classes"
path=
"src/test/java"
>
<attributes>
<attribute
name=
"optional"
value=
"true"
/>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
<attribute
name=
"test"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"output"
path=
"target/classes"
/>
</classpath>
.gitignore
0 → 100644
View file @
dd888bc9
/target/
.project
0 → 100644
View file @
dd888bc9
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
demo
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.eclipse.jdt.core.javabuilder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.m2e.core.maven2Builder
</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
org.eclipse.jdt.core.javanature
</nature>
<nature>
org.eclipse.m2e.core.maven2Nature
</nature>
</natures>
</projectDescription>
.settings/org.eclipse.core.resources.prefs
0 → 100644
View file @
dd888bc9
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
.settings/org.eclipse.jdt.core.prefs
0 → 100644
View file @
dd888bc9
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
.settings/org.eclipse.m2e.core.prefs
0 → 100644
View file @
dd888bc9
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
src/main/java/com/altimetrik/Application.java
View file @
dd888bc9
package
com
.
altimetrik
;
import
java.util.Scanner
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
com.altimetrik.demo.model.AccountantFirm
;
import
com.altimetrik.demo.model.EngineerFirm
;
@SpringBootApplication
@EnableAsync
public
class
Application
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"App started...miami demo - day 2 Welcome to Articles Publishing Service."
);
SpringApplication
.
run
(
Application
.
class
,
args
);
}
}
src/main/java/com/altimetrik/demo/model/AccountantFirm.java
0 → 100644
View file @
dd888bc9
package
com
.
altimetrik
.
demo
.
model
;
public
class
AccountantFirm
extends
EngineerFirm
{
public
AccountantFirm
(
int
n
)
{
super
(
n
);
}
public
void
assignSalaries
(
int
[]
salaries
)
{
super
.
assignIncome
(
salaries
);
printMessages
(
0
,
""
,
"accountants"
);
}
public
void
maxSalary
()
{
printMessages
(
super
.
MaxSalary
(),
"max"
,
"accountants"
);
}
public
void
minSalary
()
{
printMessages
(
super
.
MinSalary
(),
"min"
,
"accountants"
);
}
public
void
averageSalary
()
{
printMessages
(
super
.
AveSalary
(),
"ave"
,
"accountants"
);
}
}
src/main/java/com/altimetrik/demo/model/Company.java
0 → 100644
View file @
dd888bc9
package
com
.
altimetrik
.
demo
.
model
;
public
interface
Company
{
void
assignSalaries
(
int
[]
salaries
);
void
averageSalary
();
void
maxSalary
();
void
minSalary
();
}
\ No newline at end of file
src/main/java/com/altimetrik/demo/model/EngineerFirm.java
0 → 100644
View file @
dd888bc9
package
com
.
altimetrik
.
demo
.
model
;
import
java.util.Arrays
;
import
java.util.IntSummaryStatistics
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
EngineerFirm
{
private
final
int
[]
income
;
public
EngineerFirm
(
int
n
)
{
income
=
new
int
[
n
];
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
income
[
i
]
=
0
;
}
}
public
static
void
printMessages
(
double
salaryAmount
,
String
salarySpecification
,
String
profession
)
{
switch
(
salarySpecification
)
{
case
"max"
:
System
.
out
.
print
(
"Maximum salary amongst "
+
profession
);
System
.
out
.
printf
(
" is %d"
,
(
int
)
salaryAmount
);
System
.
out
.
println
(
""
);
break
;
case
"min"
:
System
.
out
.
print
(
"Minimum salary amongst "
+
profession
);
System
.
out
.
printf
(
" is %d"
,
(
int
)
salaryAmount
);
System
.
out
.
println
(
""
);
break
;
case
"ave"
:
System
.
out
.
print
(
"Average salary of "
+
profession
);
System
.
out
.
printf
(
" is %.2f"
,
salaryAmount
);
System
.
out
.
println
(
""
);
break
;
default
:
System
.
out
.
println
(
"Incomes of "
+
profession
+
" credited"
);
break
;
}
}
public
void
assignSalaries
(
int
[]
salaries
)
{
if
(
salaries
!=
null
)
{
assignIncome
(
salaries
);
printMessages
(
0
,
""
,
"engineers"
);
}
}
public
void
maxSalary
()
{
printMessages
(
MaxSalary
(),
"max"
,
"engineers"
);
}
public
void
minSalary
()
{
printMessages
(
MinSalary
(),
"min"
,
"engineers"
);
}
public
void
averageSalary
()
{
printMessages
(
AveSalary
(),
"ave"
,
"engineers"
);
}
public
Integer
MaxSalary
()
{
List
<
Integer
>
list
=
Arrays
.
stream
(
income
).
boxed
().
collect
(
Collectors
.
toList
());
return
list
.
stream
().
max
(
Integer:
:
compare
).
get
();
}
public
Integer
MinSalary
()
{
List
<
Integer
>
list
=
Arrays
.
stream
(
income
).
boxed
().
collect
(
Collectors
.
toList
());
return
list
.
stream
().
min
(
Integer:
:
compare
).
get
();
}
public
double
AveSalary
()
{
List
<
Integer
>
list
=
Arrays
.
stream
(
income
).
boxed
().
collect
(
Collectors
.
toList
());
IntSummaryStatistics
stats
=
list
.
stream
().
mapToInt
((
x
)
->
x
).
summaryStatistics
();
return
stats
.
getAverage
();
}
public
void
assignIncome
(
int
[]
salaries
)
{
System
.
arraycopy
(
salaries
,
0
,
income
,
0
,
Math
.
min
(
income
.
length
,
salaries
.
length
));
}
}
\ No newline at end of file
src/main/java/com/altimetrik/demo/model/Solution.java
0 → 100644
View file @
dd888bc9
package
com
.
altimetrik
.
demo
.
model
;
import
java.util.Scanner
;
public
class
Solution
{
public
static
void
main
(
String
[]
args
)
{
// TODO Auto-generated method stub
Scanner
sc
=
new
Scanner
(
System
.
in
);
String
[]
count
=
sc
.
nextLine
().
split
(
" "
);
EngineerFirm
e
=
new
EngineerFirm
(
Integer
.
parseInt
(
count
[
0
]));
AccountantFirm
a
=
new
AccountantFirm
(
Integer
.
parseInt
(
count
[
1
]));
count
=
sc
.
nextLine
().
split
(
" "
);
int
[]
incomeEngineers
=
new
int
[
count
.
length
];
for
(
int
i
=
0
;
i
<
count
.
length
;
i
++)
{
incomeEngineers
[
i
]
=
Integer
.
parseInt
(
count
[
i
]);
}
e
.
assignSalaries
(
incomeEngineers
);
count
=
sc
.
nextLine
().
split
(
" "
);
int
[]
incomeAccountants
=
new
int
[
count
.
length
];
for
(
int
i
=
0
;
i
<
count
.
length
;
i
++)
{
incomeAccountants
[
i
]
=
Integer
.
parseInt
(
count
[
i
]);
}
a
.
assignSalaries
(
incomeAccountants
);
e
.
averageSalary
();
e
.
maxSalary
();
e
.
minSalary
();
a
.
averageSalary
();
a
.
maxSalary
();
a
.
minSalary
();
}
}
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