Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Assessment 3
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
daniel.parker
Assessment 3
Commits
402af014
Commit
402af014
authored
Dec 03, 2018
by
daniel.parker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial.
parent
a7175211
Pipeline
#385
failed with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
AssessmentPartThree.java
src/AssessmentPartThree.java
+23
-21
No files found.
src/AssessmentPartThree.java
View file @
402af014
public
class
AssessmentPartThree
{
public
class
AssessmentPartThree
{
// The simplest form of encryption is the rotation cipher (also known as Caeser's Cipher)
// The simplest form of encryption is the rotation cipher (also known as
// An offset value is chosen to encrypt a message. Each letter is replaced by the
// Caeser's Cipher)
// An offset value is chosen to encrypt a message. Each letter is replaced by
// the
// letter that that number of places away from it.
// letter that that number of places away from it.
// So if an offset value of 1 is chosen, each letter is replaced by the one after it
// So if an offset value of 1 is chosen, each letter is replaced by the one
// after it
// - so a becomes b, b becomes c, etc
// - so a becomes b, b becomes c, etc
// If a value of -2 is chosen a becomes y, b becomes z and so on
// If a value of -2 is chosen a becomes y, b becomes z and so on
......
public
char
enryptedCharacter
(
char
theChar
,
int
theOffset
)
{
public
char
enryptedCharacter
(
char
theChar
,
int
theOffset
)
{
char
returnChar
=
theChar
;
char
returnChar
=
theChar
;
...
@@ -48,9 +51,8 @@ public class AssessmentPartThree {
...
@@ -48,9 +51,8 @@ public class AssessmentPartThree {
for
(
int
i
=
0
;
i
<
theMessage
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
theMessage
.
length
();
i
++)
{
char
character
=
theMessage
.
charAt
(
i
);
char
character
=
theMessage
.
charAt
(
i
);
codedString
+=
enryptedCharacter
(
character
,
theOffset
);
codedString
+=
enryptedCharacter
(
character
,
theOffset
);
//codedString = String.valueOf(theMessageChars);
}
}
return
codedString
;
return
codedString
;
}
}
...
...
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