Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
HW2 Task manager
Project
Project
Details
Activity
Releases
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
diana.alkateeb
HW2 Task manager
Commits
e59bbe2f
Commit
e59bbe2f
authored
Nov 15, 2023
by
diana.alkateeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add IsPalindrome Task
parent
fbac4896
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
TaskIsPalindrome.java
src/task/TaskIsPalindrome.java
+27
-0
No files found.
src/task/TaskIsPalindrome.java
0 → 100644
View file @
e59bbe2f
package
task
;
public
class
TaskIsPalindrome
extends
TaskImpl
{
@Override
public
void
execute
()
{
try
{
int
n
=
Integer
.
valueOf
(
input
);
result
=
palindrome
(
n
);
}
catch
(
Exception
e
)
{
result
=
"Exception: "
+
e
.
getMessage
();
}
}
private
String
palindrome
(
int
n
)
{
int
temp_n
=
n
;
int
reversed_n
=
0
;
while
(
temp_n
>
0
)
{
reversed_n
=
reversed_n
*
10
+
temp_n
%
10
;
temp_n
=
temp_n
/
10
;
}
if
(
n
==
reversed_n
){
return
(
"Is Palindrome"
);}
else
{
return
(
"Is Not Palindrome"
);}
}
}
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