Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Programing 01 2019 Resubmission
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
louie.bridges
Programing 01 2019 Resubmission
Commits
668a3213
Commit
668a3213
authored
Apr 04, 2019
by
louie.bridges
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Final Resub Commit.
parent
1f5e804b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
4 deletions
+67
-4
ResitCode.java
src/ResitCode.java
+35
-4
ResitTest.java
src/ResitTest.java
+32
-0
No files found.
src/ResitCode.java
View file @
668a3213
import
java.util.ArrayList
;
// import the ArrayList class
public
class
ResitCode
{
public
int
Fib_No
(
int
position
)
{
ArrayList
<
Integer
>
fibList
=
new
ArrayList
<
Integer
>();
//Adds 0 and 1 to the ArrayList
fibList
.
add
(
0
);
fibList
.
add
(
1
);
//For loop for the Fibonacci sequence.
for
(
int
i
=
0
;
i
<
position
;
i
++)
{
fibList
.
add
(
fibList
.
get
(
fibList
.
size
()
-
1
)+
fibList
.
get
(
fibList
.
size
()
-
2
));
}
public
String
pigLatin
(
String
message
)
{
return
fibList
.
get
(
position
-
1
);
}
public
String
pigLatin
(
String
message
)
{
String
Newsentence
=
""
;
String
[]
words
;
Newsentence
=
message
;
words
=
Newsentence
.
split
(
" "
);
String
sentence
=
""
;
for
(
String
letters
:
words
)
{
sentence
+=
letters
.
substring
(
1
)
+
letters
.
substring
(
0
,
1
)
+
"ay "
;
}
return
sentence
.
trim
();
}
}
src/ResitTest.java
0 → 100644
View file @
668a3213
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
import
org.junit.jupiter.api.AfterAll
;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.BeforeAll
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
class
ResitTest
{
@BeforeAll
static
void
setUpBeforeClass
()
throws
Exception
{
}
@AfterAll
static
void
tearDownAfterClass
()
throws
Exception
{
}
@BeforeEach
void
setUp
()
throws
Exception
{
}
@AfterEach
void
tearDown
()
throws
Exception
{
}
@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