Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Prog 01 resit
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
leon.bellerby
Prog 01 resit
Commits
2909d5fe
Commit
2909d5fe
authored
Apr 04, 2019
by
leon.bellerby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final Commit
parent
1f5e804b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
ResitCode.java
src/ResitCode.java
+22
-2
ResitTest.java
src/ResitTest.java
+12
-0
No files found.
src/ResitCode.java
View file @
2909d5fe
...
...
@@ -3,12 +3,32 @@ import java.util.ArrayList; // import the ArrayList class
public
class
ResitCode
{
public
int
Fib_No
(
int
position
)
{
ArrayList
<
Integer
>
list
=
new
ArrayList
<
Integer
>();
list
.
add
(
0
);
list
.
add
(
1
);
for
(
int
i
=
0
;
i
<
position
;
i
++)
{
list
.
add
(
list
.
get
(
list
.
size
()-
1
)+
list
.
get
(
list
.
size
()-
2
));
}
return
list
.
get
(
position
-
1
);
}
public
String
pigLatin
(
String
message
)
{
String
newPig
=
""
;
String
[]
word
;
newPig
=
message
;
word
=
newPig
.
split
(
" "
);
String
incredibilis
=
""
;
for
(
String
piglets
:
word
)
{
incredibilis
+=
piglets
.
substring
(
1
)
+
piglets
.
substring
(
0
,
1
)
+
"ay "
;
}
return
incredibilis
.
trim
();
}
}
src/ResitTest.java
0 → 100644
View file @
2909d5fe
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
import
org.junit.jupiter.api.Test
;
class
ResitTest
{
@Test
void
test
()
{
fail
(
"Not yet implemented"
);
}
}
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