Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
alx_mszczonow_1
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_mszczonow_1
Commits
759da731
Commit
759da731
authored
Jul 10, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zadania rozwiązane "proceduralnie" - poprawki
parent
3c74648b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
6 deletions
+10
-6
ObslugaCSV.java
src/main/java/emps/ObslugaCSV.java
+4
-0
P2_WypiszBogatych.java
src/main/java/emps/P2_WypiszBogatych.java
+1
-1
P3_SredniaWszystkich.java
src/main/java/emps/P3_SredniaWszystkich.java
+2
-2
P4a_SredniaWybranych.java
src/main/java/emps/P4a_SredniaWybranych.java
+2
-2
P4b_SredniaWybranych.java
src/main/java/emps/P4b_SredniaWybranych.java
+1
-1
No files found.
src/main/java/emps/ObslugaCSV.java
View file @
759da731
...
...
@@ -21,6 +21,10 @@ public class ObslugaCSV {
String
linia
;
while
((
linia
=
reader
.
readLine
())
!=
null
)
{
String
[]
t
=
linia
.
split
(
";"
,
-
1
);
// psucie danych, aby sprawdzić porównania z nullem
// if(t[1].charAt(0) == 'A') {
// t[3] = null;
// }
Employee
emp
=
new
Employee
(
Integer
.
parseInt
(
t
[
0
]),
t
[
1
],
t
[
2
],
t
[
3
],
Integer
.
parseInt
(
t
[
4
]),
LocalDate
.
parse
(
t
[
5
]),
t
[
6
],
t
[
7
],
t
[
8
],
t
[
9
],
t
[
10
]);
...
...
src/main/java/emps/P2_WypiszBogatych.java
View file @
759da731
...
...
@@ -9,7 +9,7 @@ public class P2_WypiszBogatych {
int
ile
=
0
;
for
(
Employee
emp
:
emps
)
{
if
(
emp
.
getSalary
()
>=
10_000
)
{
System
.
out
.
printf
(
"
Pracownik
%s %s (%s) zarabia %d i pracuje w %s.\n"
,
System
.
out
.
printf
(
"%s %s (%s) zarabia %d i pracuje w %s.\n"
,
emp
.
getFirstName
(),
emp
.
getLastName
(),
emp
.
getJobTitle
(),
emp
.
getSalary
(),
emp
.
getCity
());
ile
++;
}
...
...
src/main/java/emps/P3_SredniaWszystkich.java
View file @
759da731
...
...
@@ -6,11 +6,11 @@ public class P3_SredniaWszystkich {
public
static
void
main
(
String
[]
args
)
{
List
<
Employee
>
emps
=
ObslugaCSV
.
wczytaj
();
double
suma
=
0
;
int
suma
=
0
;
for
(
Employee
emp
:
emps
)
{
suma
+=
emp
.
getSalary
();
}
double
srednia
=
suma
/
emps
.
size
();
double
srednia
=
(
double
)
suma
/
emps
.
size
();
System
.
out
.
println
(
"Średnia wszystkich: "
+
srednia
);
}
...
...
src/main/java/emps/P4
_SredniaWybranych1
.java
→
src/main/java/emps/P4
a_SredniaWybranych
.java
View file @
759da731
...
...
@@ -2,7 +2,7 @@ package emps;
import
java.util.List
;
public
class
P4
_SredniaWybranych1
{
public
class
P4
a_SredniaWybranych
{
public
static
void
main
(
String
[]
args
)
{
List
<
Employee
>
emps
=
ObslugaCSV
.
wczytaj
();
...
...
@@ -15,7 +15,7 @@ public class P4_SredniaWybranych1 {
}
}
double
srednia
=
suma
/
ile
;
System
.
out
.
println
(
"Średnia progr
ma
istów: "
+
srednia
);
System
.
out
.
println
(
"Średnia progr
am
istów: "
+
srednia
);
}
}
src/main/java/emps/P4
_SredniaWybranych2
.java
→
src/main/java/emps/P4
b_SredniaWybranych
.java
View file @
759da731
...
...
@@ -5,7 +5,7 @@ import java.util.Objects;
import
javax.swing.JOptionPane
;
public
class
P4
_SredniaWybranych2
{
public
class
P4
b_SredniaWybranych
{
public
static
void
main
(
String
[]
args
)
{
String
szukanyJob
=
JOptionPane
.
showInputDialog
(
"Podaj nazwę stanowiska"
);
...
...
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