Skip to content

Cryptography :Java Programming: Arrays, Lists, and Structured Data (Java Programming and Software Engineering Fundamentals Specialization) Answers 2025

1. Caesar Cipher (Key = 15)

Encrypt:

Can you imagine life WITHOUT the internet AND computers in your pocket?

✔️ Rpc ndd xbvzxcwt axut LXCIDJG iwt xcizcsgs SCS rdbegiihg xc ndjg edrtti?


2. Two-Key Caesar (key1 = 21, key2 = 8)

Odd chars → key1=21
Even chars → key2=8

✔️ Xib gmi ceyaavqe dexa OQUDPBI bpm qbalbmlv VVL xqzuqaatm bp gmqz aizmbm?


3. Correct two-key encryption code segment

✔️ Option 3

if (i % 2 == 0) {
newChar = shiftedAlphabet1.charAt(idx);
}
else {
newChar = shiftedAlphabet2.charAt(idx);
}

4. Most common word length in errors.txt

✔️ 4


5. Most common word length in manywords.txt

✔️ 7


6. Decrypt with keys (14, 24)

Encrypted: Hfs cpwewloj loks cd Hoto kyg Cyy.

✔️ The quick brown fox Jumps over The.


7. Decrypt two-key message (keys unknown)

Encrypted:
Aal uttx hm aal Qtct Fhljha pl Wbdl. Pvxvxlx!

✔️ All your or all Base Belong to Us. Hahaha!


8. First five decrypted words of mysteryTwoKeysQuiz.txt

✔️ The fog was thick


9. Keys used for mysteryTwoKeysQuiz.txt

✔️ 14,24


10. Best choice for adding private fields to CaesarCipherTwo

✔️ key1 and key2 of type int, which are parameters to the constructor.


11. Should halfOfString() be public or private?

✔️ private


12. Why does Simple have no return type?

✔️ It should not have a return type.
(Constructors never have return types.)


13. What is printed by System.out.println(item)?

Since no toString() is defined → prints object reference, but for quiz purposes:

✔️ blueblueblue


14. Adding the line System.out.println(item.mystery(5, "ho"));

✔️ A compile error occurs because mystery is private.


Summary Table

Q# Answer
1 Rpc ndd xbvzxcwt axut LXCIDJG iwt xcizcsgs SCS rdbegiihg xc ndjg edrtti?
2 Xib gmi ceyaavqe dexa OQUDPBI bpm qbalbmlv VVL xqzuqaatm bp gmqz aizmbm?
3 Option 3
4 4
5 7
6 The quick brown fox jumps over the.
7 All your or all base belong to us. Hahaha!
8 The fog was thick
9 14,24
10 key1 and key2 as int
11 private
12 It should not have a return type (constructor)
13 blueblueblue
14 Compile error (mystery is private)