U3F1ZWV6ZTUwMjQyMDg4NzA2MDg4X0ZyZWUzMTY5NzA1NDAzMjU3Mg==

java programming arrays, lists and structured data week 1 quiz answers

 week 1:

Cryptography

This is java programming arrays, lists and structured data week 1 quiz answers. you will not need any other answers to solve this java programing questions.

You need to know about this java programming course that make you good in learning how to make arrays, lists and structured(object) of data.

Quiz, 14 questions
1. Question 1
Encrypt the following phrase with the Caesar Cipher algorithm, using key 15.
Can you imagine life WITHOUT the internet AND computers in your pocket?
What is the encrypted string?

the answer is here:

Rpc ndj xbpvxct axut LXIWDJI iwt xcitgcti PCS rdbejitgh xc ndjg edrzti?
2. Question 2
Encrypt the following phrase with the algorithm described for using two Caesar Cipher keys, with key1 = 21 and key2 = 8.
Can you imagine life WITHOUT the internet AND computers in your pocket?
What is the encrypted string?

the answer is here:

Xai twp duaodvz gqam EDBCWPB bcm qibzzimo AVY xwhxpbzzn dv gjcm kwxszb?
3. Question 3
Consider the Caesar Cipher two-key algorithm described in this course. Every other character, starting with the first, will use the Caesar Cipher algorithm with key1, and every other character, starting with the second, will use the Caesar Cipher algorithm with key2.
Assume shiftedAlphabet1 is the shifted alphabet using key1 and shiftedAlphabet2 is the shifted alphabet using key2, both are of type String.
If i is the location of the current character in the message, and idx is the integer variable of the location of the current character in the original alphabet, which one of the following segments of code correctly gets the corresponding encrypted character?

the answer is here:

if (i % 2 == 0) {
newChar = shiftedAlphabet1.charAt(idx);
}
else {
newChar = shiftedAlphabet2.charAt(idx);
}
4. Question 4
Consider the file errors.txt.
What is the most common word length (ignoring the punctuation of the first and last character of each group of characters)?

the answer is here:

4
5. Question 5
Consider the file manywords.txt.
What is the most common word length (ignoring the punctuation of the first and last character of each group of characters)?

the answer is here:

7
6. Question 6
The following phrase was encrypted with the two-key encryption method we discussed using the two keys 14 and 24. What is the decrypted message?

the answer is here:

The original name of Java was Oak.
7. Question 7
The following phrase was encrypted with the two-key encryption method described in this course. You will need to figure out which keys were used to encrypt it.
Aal uttx hm aal Qtct Fhljha pl Wbdl. Pvxvxlx!
What is the original message?

the answer is here:

The name of the Java Mascot is Duke. Woeoeee!
8. Question 8
Decrypt the encrypted file mysteryTwoKeysQuiz.txt.
This file is encrypted with the two-key encryption method we discussed. You’ll need to decrypt the complete file by figuring out which keys were used to decrypt it.
What are the first five decrypted words?
(Note: Spacing and punctuation should be preserved in your answer.)

the answer is here:

Duke Computer Science Department Overview
9. Question 9
Decrypt the encrypted file mysteryTwoKeysQuiz.txt.
This file is encrypted with the two-key encryption method we discussed. You’ll need to decrypt the complete file by figuring out which keys were used to decrypt it.
What are the two keys used to encrypt it?
Note: Enter your answer as firstkey,secondkey with no spaces, for example:

the answer is here:

17,4
10. Question 10
Which of the following is the best choice for adding additional private fields to the CaesarCipherTwo class created in the last lesson to make it easier to call decrypt on a string that was encrypted using an object of this class?

the answer is here:

As key1 and key2 of type int, which are parameters to the constructor.
11. Question 11
Should the halfOfString method in the TestCaesarCipherTwo class be public or private?

the answer is here:

private
12. Question 12
Consider the following two classes Simple and TestSimple for the remaining questions.
public class Simple{
private String word;
private String phrase;
public Simple(int number, String w) {
word = w;
phrase = mystery(number, w);
}
private String mystery(int num, String s) {
String answer = "";
for (int k=0; k<num; k++) {
answer = answer + s;
}
return answer;
}
public String toString() {
return phrase + " is " + word + " repeated";
}
}
public class TestSimple{
public void print() {
Simple item = new Simple(3, "blue");
System.out.println(item);
}
}
Why is there no return type for the method Simple?

the answer is here:

It should not have a return type.
13. Question 13
public class Simple{
private String word;
private String phrase;
public Simple(int number, String w) {
word = w;
phrase = mystery(number, w);
}
private String mystery(int num, String s) {
String answer = "";
for (int k=0; k<num; k++) {
answer = answer + s;
}
return answer;
}
public String toString() {
return phrase + " is " + word + " repeated";
}
}
public class TestSimple{
public void print() {
Simple item = new Simple(3, "blue");
System.out.println(item);
}
}
What is printed when the print method in TestSimple is called?

the answer is here:

blueblueblue is blue repeated
14. Question 14
public class Simple{
private String word;
private String phrase;
public Simple(int number, String w) {
word = w;
phrase = mystery(number, w);
}
private String mystery(int num, String s) {
String answer = "";
for (int k=0; k<num; k++) {
answer = answer + s;
}
return answer;
}
public String toString() {
return phrase + " is " + word + " repeated";
}
}
public class TestSimple{
public void print() {
Simple item = new Simple(3, "blue");
System.out.println(item);
}
}
Suppose the following line is added as the last line in the print method of the class TestSimple.
System.out.println(item.mystery(5, "ho"));
How does this line affect what happens with the code in the print method?

the answer is here:

A compile error occurs when compiling this class, because mystery is private and cannot be called by the TestSimple class.

introduction...

About this Course

Build on the software engineering skills you learned in “Java Programming Solving Problems with Software” by learning new data structures. Use these data structures to build more complex programs that use Java’s object-oriented features. At the end of the course you will write an encryption program and a program to break your encryption algorithm.

After completing this course, you will be able to:

help you to practice your skills in structured data(arrays, lists and objects) by doing some quiz by week, you need to answer to pass this course. size of program doesn't matter or what type of coding, you just need to know how the language work and what fundamentals do you need to learn to act with it. arrays, lists and structured data are using in many fields. structure need to be built with some data, arraylists, arrays and lists to make a useful program that can be used. testing yourself with quiz or exam, study uploaded chapter and make interview to make sure you can finally work with real world problem, and applying for job(javascript, html, stack, css, csv .....). work with all items, method and class in hours to make good work

1. Read and write data from/to files in ordered list. 2. Solve real world problems involving data files. 3. Perform quantitative analyses of structured data (e.g., finding maximums, minimums, averages). 4. Store and manipulate data in an array or Array List. 5. Combine multiple classes and objects to solve larger problems. 6. Use iterables and collections (including maps) in Java.

some task you will learn to solve anther time java programming graph needed to wright with coding. anther courses help you explore high level tools to make development and help any web site developed by adding new features. and computer science is very enjoyable capturing various information, it's like university to you help you practice getting natural job. you can look or search about java programing, and you can choose to start today or not developing android, but you have to make correct decision and discover projects (written specialization, designed content).

and now with this course you will begin to learn object oriented language.

some reviews:

-Actually, before I start this course I had not a good idea about OOP concept such as constructors, HashMap.now I have fair confidence about that. thank you duke university making such an arrangement. 

-Good and practical training approach to solve real worlds problems. Assignments and quizzes are quite challenging and interesting. Greatly motivates us towards programming and problem solving skills.

-The course was pretty challenging (and occasionally frustrating) for a novice programmer, but doable.\n\nI enjoyed the course, and came away with a greater understanding of computers and programming.

-The programming exercises are really interesting! They make programming much more fun to study. The lecturers are all great and the lessons are engaging. Enjoyed it greatly! Thank you Duke.

تعديل المشاركة
author-img

Steven Hany

hey I'm Steven, I studied Programming Foundations with JavaScript, HTML and CSS, Java Programming: Solving Problems with Software, Java Programming: Arrays, Lists, and Structured Data and Java Programming: Principles of Software Design, Java Programming: Build a Recommendation System ... And here is some answers
Comments
No comments
Post a Comment

Post a Comment

Leave a message

NameEmailMessage