Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20230403
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
20230403
Commits
f04bdbb5
Commit
f04bdbb5
authored
May 24, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ktoraGodzina i oblicz
parent
f113ca2f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
Usluga.java
PC31-SoapSerwer/src/main/java/hello/Usluga.java
+14
-3
No files found.
PC31-SoapSerwer/src/main/java/hello/Usluga.java
View file @
f04bdbb5
package
hello
;
import
java.time.LocalDateTime
;
import
jakarta.jws.WebService
;
@WebService
...
...
@@ -13,9 +15,18 @@ public class Usluga {
return
"Witaj "
+
imie
;
}
// TODO dodaj dwie metody:
// - zwracanie bieżącego czasu
// - oblicz(int x, int y, String operacja)
public
String
ktoraGodzina
()
{
return
LocalDateTime
.
now
().
toString
();
}
public
int
oblicz
(
int
x
,
int
y
,
String
operacja
)
{
return
switch
(
operacja
)
{
case
"+"
->
x
+
y
;
case
"-"
->
x
-
y
;
case
"*"
->
x
*
y
;
case
"/"
->
x
/
y
;
default
->
throw
new
IllegalArgumentException
(
"Nieznana operacja "
+
operacja
);
};
}
}
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