Starting from:

$24.99

CMSC203 Assignment 3 Solution



• Implement each of the methods specified in this file. This version as provided will print error messages in the console, because they are just the skeletons.
Each of the methods are static, so there is no need to create an instance of the Data Manager.
Document each of your methods with a simple description and document the class with a simple description and your name using in-line comments (//…). (Just a short sentence fragment will suffice for each documentation string.)
The methods are described below. o public static boolean isStringInBoundsstringInBounds (String plainText)
➢ This method determines if a string is within the allowable bounds of ASCII codes according to the LOWER_BOUND_RANGE and UPPER_BOUND_RANGE characters.
➢ The parameter plainText is the string to be encrypted.
➢ The method returns true if all characters are within the allowable bounds, false if any character is outside.
o public static String caesarEncryptionencryptCaesar (String plainText, int key)
➢ This method encrypts a string according to the Caesar Cipher.
➢ The parameter plainText is an uppercase string to be encrypted.
➢ The parameter integer key specifies an offset and each character in plainText is replaced by the character the specified distance away from it.
➢ The method returns the encrypted string.
➢ If the plainText is not in bounds, the method returns:
o The selected string is not in bounds, Try again.
o public static String caesarDecryption decryptCaesar (String encryptedText, int key)
➢ This method decrypts a string according to the Caesar Cipher.
➢ This is the inverse of the caesarEncryptionencryptCaesar method.
➢ The parameter encryptedText is the encrypted string to be decrypted, and key is the integer used to encrypt the original text.
➢ The integer key specifies an offset and each character in encryptedText is replaced by the character "offset" characters before it. ➢ The method returns the original plain text string.
o public static String bellasoDecryption encryptBellaso (String plainText, String bellasoStr)
➢ This method encrypts a string according to the Bellaso Cipher.
➢ Each character in plainText is offset according to the ASCII value of the corresponding character in bellasoStr, which is repeated to correspond to the length of plaintext. The method returns the encrypted string.
o public static String bellasoDecryptiondecryptBellaso(String encryptedText, String bellasoStr)
➢ This method decrypts a string according to the Bellaso Cipher.
Formatted: Font: 12 pt
Formatted: Font: Bold
Formatted: Font: 12 pt
Formatted: Font: 12 pt
Formatted: Font: Bold
Formatted: Font: 12 pt
Formatted: Font: Bold
Formatted: Font: 12 pt
Formatted: Font: Bold
Formatted: Font: 12 pt
Formatted: Font: Bold
➢ Each character in encryptedText is replaced by the character corresponding to the character in bellasoStr, which is repeated to correspond to the length of plainText. ➢ This is the inverse of the bellasoDecryption encryptBellaso method.
➢ The parameter encryptedText is the encrypted string to be decrypted, ➢ The parameter bellasoStr is the string used to encrypt the original text. ➢ The method returns the original plain text string.
GUI Driver class – FXDriver and FXMainPane (provided)
A Graphical User Interface (GUI) is provided. Be sure that the GUI will compile and run with your methods. The GUI will not compile if your method headers in CryptoManager.java are not exactly in the format specified. When you first run the application, your methods will all throw exceptions, which will be caught by the GUI and printed out in the console.
The GUI takes care of capitalizing your input strings.

You can take a look at provided CryptoManagerTestPublic and create similar test cases, however your test string values must be different.
Include CryptoManagerTest.java with the rest of your submission.
For GFA (Good Faith Attempt) include CryptoManagerGFATest.java (only) with the rest of your submission.



Since our specified range does not include lower-case letters, the GUI (provided) will change strings to upper case. You can find the ASCII table at http://www.asciitable.com/, or many other places on the Internet.

Caesar Cipher:
The first approach is called the Caesar Cipher and is a simple “substitution cipher” where characters in a message are replaced by a substitute character. The substitution is done according to an integer key which specifies the offset of the substituting characters. For example, the string ABC with a key of 3 would be replaced by DEF.
If the key is greater than the range of characters we want to consider, we “wrap around” by subtracting the range from the key until the key is within the desired range. For example, if we have a range from space (‘ ‘) to ‘_’ (i.e., ASCII 32 to ASCII 95), and the key is 120, we note that 120 is outside the range. So, we subtract 95-32+1=64 from 120, giving 56, which in ASCII is the character ‘8’. If the key is even higher, we can subtract the range from the key over and over until the key is within the desired range.
Can we make GFA and public the same and get rid of public?

Giovan Battista Bellaso:
So, for the string ABCDEFG and the key word CMSC:
• The key word is first extended to the length of the string, i.e., CMSCCMS.
• Then A is replaced by ‘A’ offset by ’C’, i.e., ASCII 65+67=132. The range of the characters is also specified, and again we’ll say ‘ ‘ to ‘_’ (i.e., ASCII 32 to ASCII 95). The range is then 95-
32+1=64. In our example, the offset is “wrapped” by reducing 132 by the range until it is the allowable range. 132 is adjusted to 132-64=68, or character ‘D’ in the encrypted phase.
• Then the same logic is applied to the second letter of the plain text ‘B’ shifted by the second letter of the key word ‘M’. This results in the character ‘O’ as the second letter in the encrypted phase, and so on.
• In each approach, if the resulting integer is greater than 95 (the top of our range), the integer is
“wrapped around” so that it stays within the specified range.
• The result is “DOVGHSZ”.
Your program will implement several methods that are specified in the file “CryptoManager.java”. A Graphical User Interface is provided, as well as a test file, that you should use to make sure your methods work correctly. Be sure to follow the naming exactly, as the tests will not work otherwise.











* to any student.
Print your Name here: __________ */

Design Formatted: Font: Times New Roman, 12 pt
Turn in pseudo-code for each of the methods specified in CryptoManager.java. Your pseudo-code Formatted: Font: 12 pt should be part-way between English and java. There is no need to spell out all the details of variable Formatted: No bullets or numbering declaration, etc., but by the same token, the pseudo-code needs to have enough detail that a competent Java programmer could implement it. Alternately, turn in a UML class diagram specifying the methods and fields.
Implementation
Note: Only submit the files that are created/modified by per requirement. DO NOT submit the files that are already provided for you.
The deliverables will be packaged as follows. Two compressed files in the following formats:
• FirstInitialLastName_Assignment3_Complete.zip, a compressed file in the zip format, with the following:
• src folder:
• CryptoManager.java
• CryptoManagerTestStudent.java
• Word document that includes (use provided template):
1. Pseudocode for each of the methods specified in CryptoManager.java.
2. Screenshots:
a. Screen snapshots of outputs from Eclipse based on your Test Plan
b. Screen shot of src folder files in your GitHub repository
3. Lessons Learned: Provide answers to the questions listed below:
a. Write about your Learning Experience, highlighting your lessons learned and learning experience from working on this project.
b. What have you learned?
c. What did you struggle with?


▪ FirstInitialLastName_Assignment4_JavaFiles.zip, a compressed file containing one or more Java files (This folder SHOULD NOT contain any folders and it SHOULD contain
Java source file only that are created/modified by you per requirement.) Formatted: Font: 12 pt
• CryptoManager.java
• CryptoManagerTestStudent.java

Design
Turn in pseudo-code for each of the methods specified in CryptoManager.java. Your pseudo-code should be part-way between English and java. There is no need to spell out all the details of variable declaration, etc., but by the same token, the pseudo-code needs to have enough detail that a competent Java programmer could implement it. Alternately, turn in a UML class diagram specifying the methods and fields.
Turn in a test table with
o at least two tests for the Caesar Cipher encryption o at least two tests for the Caesar Cipher decryption o at least two tests for the Bellaso Cipher encryption o at least two tests for the Bellaso Cipher decryption o at least one string that will fail because it has characters outside the acceptable ones.

Implementation
The Java application must compile and run correctly, otherwise Assignment grade will be 0.
The deliverables will be packaged as follows. Two compressed files in the following formats:
• FirstInitialLastName_Assignment3_Complete.zip, a compressed file in the zip format, with the following:
• Source Code: Java Files; o Only include the ones you created or modified per assignment requirement.
• Word document with a name FirstInitialLastName_Assignment3.docx should include:
o Pseudocode for each of the methods specified in CryptoManager.java. (Revised from initial design if necessary)
o Test Plan (Revised from initial design if necessary) o Screen snapshots of outputs from Eclipse based on your Test Plan o Screen snapshots of Junit Test for each method o Screen snapshot of GitHub submission
• Lessons Learned: highlight your lessons learned and learning experience from working on this project. o What have you learned? o What did you struggle with? o What will you do differently on your next project? o Include what parts of the project you were successful at, and what parts (if any) you were not successful at.
• Check List
A zip file will only contain the .java files and will be named:
FirstInitialLastName_Assignment3_javaFiles.zip .

o This .zip will not have any folders in it – only .java files.
o This .zip should include the java files that you created or modified per assignment requirement.




Input text Input Key
Encrypted (method1) Encrypted (method2)
Decrypt (method1) Decrypt (method2)


Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Grading Rubric Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63
cm
CMSC203 Grading Rubric - Assignment 3 Possible total grade: 100

Name _____________________________

TESTING
Project must compile. If it doesn't compile 0
Project must run. If it's run time error 0
Passes Public JUnit tests and running project tests (for each test) 25
Possible Sub-total 100

REQUIREMENTS (Subtracts from TESTING total)
Documentation:
Documentation within source code is missing or incorrect -10
Description of what class does is missing
Author’s Name is missing
Methods not commented
Additional Comments to clarify a code inside a program are missing
Header Comments are missing
MOSS files were missing -5
Screenshots of at least two tests for the Caesar Cipher are missing -5
Screenshots of at least two tests for the Bellaso Cipher are missing -5
Screenshots of test cases based on Test Plan are missing -5
Screenshot of GitHub with uploaded Assignment 3 Files is missing -5
Pseudocode for each method specified in CryptoManager.java is missing -15
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted ...
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted ...
Formatted ...
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted ...
Formatted ...
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted ...
Formatted ...
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted ...
Formatted ...
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted ...
Formatted ...
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted ...
Test Plan is missing -10
Assignment 3 Checklist is missing -5
Learning Experience -5
Highlight your lessons learned and learning experience
from working on this project. What have you learned? What did you struggle with?
What would you do differently on your next project? What parts of the project were
you successful with, and what parts (if any) were you not successful with?
Programming Style:
Incorrect use of indentation, naming convention, etc. (see coding/style standards) -15
Design:
Data Manager – CryptoManager -20
Methods do not follow provided requirements

Deliverables
Files are submitted as compressed files using the format explained in assignment -5
Possible decrements: -100

Possible total grade: 100
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm, First line: 0 ch
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm, First line: 0 ch
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm
Formatted: Bulleted, Left, Indent: Left: 0 cm, Hanging: 0.63 cm

More products