CS 2104 Final Review

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/83

encourage image

There's no tags or description

Looks like no tags are added yet.

84 Terms

1
New cards

Which of the following are the benefits of cryptography?

Confidentiality, Integrity, Authentication, Non-repudiation

2
New cards

T/F - In public/private key cryptography if some data is encrypted with a public key then it can only be decrypted by the corresponding private key.

True

3
New cards

T/F - In public/private key cryptography if some data is encrypted with a private key then it can only be decrypted by the corresponding public key.

True

4
New cards

What is the name of the process of encrypting text by shifting (rotating) letters by a fixed number?

Caesar Cipher

5
New cards

T/F - Any polyalphabetic cipher is perfectly immune to frequency analysis.

False

6
New cards

T/F - Monoalphabetic substitution ciphers are (relatively) easily cracked via frequency analysis.

True

7
New cards

Which of the following is not a required property of an Algorithm?

Aesthetics

8
New cards

T/F - For each problem or class of problems, there may be many different algorithms.

True

9
New cards

T/F - Natural language is the most concise and precise way to express algorithms.

False

10
New cards

T/F - Flow charts symbols are mostly standardized.

True

11
New cards

Whatwill be printed when the following statements execute?

origlist = [45, 76, 34, 55]

newlist = [origlist] * 3

print(newlist)

[[45, 76, 34, 55], [45, 76, 34, 55], [45, 76, 34, 55]]

newlist is a list of three reference to origlist that were created by the repetition operator.

12
New cards

What will be printed when the following statements execute?

n = 1

x = 2

while n < 5:

n = n + 1

x = x + 1

n = n + 2

x = x + n

print(n, x)

7 15

13
New cards

What is the first line of code the python interpreter executes?

1 def sumTo(aBound):

2 theSum = 0

3 for aNumber in range(1, aBound + 1):

4 theSum - theSum + aNumber

5

6 return theSum

7

8

line 8

14
New cards

What will be printed when the following statement execute?

list = [3, 67, "cat", 3.14, False]

print(len(list))

5

15
New cards

What will be printed when the following statements execute?

alist = [1, 3, 5]

blist = [2, 4, 6]

print(alist + blist)

[1, 3, 5, 2, 4, 6]

16
New cards

What will be printed when the following statements execute?

alist = [4, 2, 8, 6, 5]

blist = alist * 2

blist[3] = 999

print(alist)

[4, 2, 8, 6, 5]

17
New cards

What will be printed when the following statements execute?

many_hellos = "hello" * 10

print(many_hellos)

hellohellohellohellohellohellohellohellohellohello

18
New cards

What will be printed when the following statements execute?

list = [3, 67, "cat", 3.14, False]

print(list[3])

3.14

19
New cards

What will be printed when the following statements execute? (The real output may require/produce several lines, for the ease of formatting, they will appear in one line.)

if 4 + 5 == 10:

print("TRUE")

else:

print("FALSE")

print("TRUE")

FALSE TRUE

20
New cards

What will be printed when the following statements execute?

origlist = [45, 76, 34, 55]

print(origlist * 3)

[45, 76, 34, 55, 45, 76, 34, 55, 45, 76, 34, 55]

21
New cards

What will be printed when the following statements execute?

list = [3, 67, "cat", 3.14, False]

print(3.14 in list)

True

22
New cards

What will be printed when the following statements execute? (The real output may require/produce several lines, for the ease of formatting, they will appear in one line.)

count = 0

while count < 5:

print(count)

count += 1

0 1 2 3 4

23
New cards

What will be printed when the following statements execute? (The real output may require/produce several lines, for the ease of formatting, they will appear in one line.)

for person in ["Ellis", "Sam", "JW"]:

print("Hi", person)

Hi Ellis Hi Sam Hi JW

24
New cards

What will be printed when the following statements execute?

fruit = ["apple", "orange", "banana", "cherry"]

print(fruit + [6, 7, 8, 9])

['apple', 'orange', 'banana', 'cherry', 6, 7, 8, 9]

25
New cards

What value is printed when the following statement executes?

print(18 // 4)

4

26
New cards

What will be printed when the following statements execute?

fruit = ["apple", "orange", "banana", "cherry"]

print("apple" in fruit, "pear" in fruit)

True False

27
New cards

What will be printed when the following statements execute?

day = "Thursday"

day = 32.5

day = 19

print(day)

19

28
New cards

What value is printed when the following statement executes?

print(18 % 4)

2

29
New cards

What will be printed when the following statements execute? (The real output may require/produce several lines, for the ease of formatting, they will appear in one line.)

name = "John"

age = 23

if name == "John" and age == 23:

print("Your name is John, and you are also 23 years old.")

if name == "John" or name == "Rick":

print("Your name is either John or Rick.")

Your name is John, and you are also 23 years old. Your name is either John or Rick.

30
New cards

What value is printed when the following statement executes?

print(18/4)

4

31
New cards

The author states that it is an exaggeration that algorithms:

rule the world

32
New cards

Deangelis discusses how Alan Turing

published a set of equations that tried to explain patterns we see in nature

33
New cards

The article does NOT describe the following weird correlations reported by Machine Learning:

CS Doctorates awarded during year arcades had higher revenue.

34
New cards

Every recursive algorithm must possess:

a base case, a recursive case, a logical guarantee that the base case is eventually reached

35
New cards

T/F - Divide and conquer algorithms recursively break down a problem into sub-problems until these become trivial to be solved directly

True

36
New cards

T/F - Horners Method is a method for computing subsequent sums.

False

37
New cards

The computation complexity for the following snippet of code is..

for (int i = 0; i < n; i++) {

for (int j = 0; j < i; j++) {

//... single operation here

}

}

O(N^2)

38
New cards

Fill in the blank:

$ ls

2017 2018 chicken_soup_recipe.txt

$ mkdir baking

$ ls

___________________

2017 2018 baking chicken_soup_recipe.txt

39
New cards

From the command line, you can navigate through files and folder son your computer, just as you would with Finder on Mac OS or Windows Explorer on Windows. The difference is that the command line__________.

is fully text-based

40
New cards

Fill in the blank:

$ ls

2017 2018 chicken_soup_recipe.txt

$ mkdir baking

$ cd baking

$ ls

______________________

NOT:

baking

2017 2018 baking

2017 2018 chicken_soup_recipe.txt

41
New cards

The mkdir command stands for __________. It takes in a directory name as (a)an ____________, and then _____________ in the current working directory.

"make directory", argument, creates a new directory

42
New cards

Fill in the blank:

$ ls

2017 2018 chicken_soup_recipe.txt

$ touch beef_soup_recipe.txt

$ ls

__________

2017 2018 beef_soup_recipe.txt chicken_soup_recipe.txt

43
New cards

T/F - CS student, Alex Chicken-Soup, types in the Unix command "ls" and his terminal displayed the following:

2017 2018 chicken_soup_recipe.txt

"ls" is an example of a command - a directive to the computer to perform a specific task.

True

44
New cards

CS student, Alex Chicken-Soup, wants to see the full pathname of the working directory using one Unix command, what command should Chicken-Soup use?

ls

pwd

45
New cards

CS student, Alex Chicken-Soup, wants to move up on directory using one Unix command. What command should Chicken-Soup use?

pd ..

mkdir .

ls ..

pd .

mkdir ..

us .

cd .

touch .

cd ..

46
New cards

In Unix, what does the command "ls" do?

Lists the files and directory in the current directory.

47
New cards

In Unix, the command "cd" stands for ________. "cd" can _________

"change directory", change the working directory

48
New cards

Requirements gathering is ...

A process of finding and discovering the requirements of a system from various sources.

49
New cards

Which of the following are examples of "Requirements Struggles"?

Contradictory requests

50
New cards

T/F - "Waterfall software development" is an updated versino of "Agile software development".

False

51
New cards

The "Analyze -- Design -- Implement -- Evaluate" loop is an approach used in _______ design.

User Interface

52
New cards

Unified Modeling Language (UML) diagrams are used in _____ design.

Object Oriented

53
New cards

Which of the following promote maintainability and reuse?

High cohesion

54
New cards

T/F - The branching feature of git allows developers to experiment without affecting the main project.

True

55
New cards

T/F - There are no tools that allow you to visualize git repository branches.

False

56
New cards

Which of the following define "black-box" testing most accurately?

Same as white-box testing

Testing software after it has crashed

Unit testing specific parts of code

Testing without the knowledge of the internals < ------

57
New cards

Which of the following do not belong to the list of ten principles of user centered design?

Perform competitor research < -----

Be consistent

Users do not know what they want < ---------

Design for the users and their tasks

Present information clearly

58
New cards

Which of the following are the four steps in the iterative (cyclical) design model?

Design

59
New cards

T/F - ARPANET is the internet of tomorrow (Web 5.0)

False

60
New cards

Which of the following missions are attributed to network protocols?

Ensuring order of transmitted packets

61
New cards

The TCP/IP model has how many layers?

4 (with margin: 0)

62
New cards

T/F - IPV6 offers 50% more address space than IPV4

False

63
New cards

Which of the following acronyms best relates to this metaphor: "it is like a phone book where the URLs(names) are mapped to the corresponding IP addresses(phone numbers)".

ICAN

DNS

64
New cards

T/F - The transport layer can only communicate with the application layer and the internet layer.

True

65
New cards

TCP/IP is a protocol at which of the following layers?

Application

Transport

66
New cards

What prevents packets from traveling between nodes indefinitely?

ICMP

MAC

ARP

TTL

67
New cards

In sending packets through a network, the TTL dield is useful because:

It shows the maximum life time for sending a packet in the network

It prevents the loops between two routers sending packets back and forth

It helps identify which packet is consuming the network resources

68
New cards

Which statement is TRUE for the packets sent through the network:

All have a fixed size

their size grows based on the size of the network

There is no measure for the size of the packet

The size differs based upon their content

69
New cards

T/F - A callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.

True

70
New cards

T/F - In the context of modern web pages JavaScript can not modify HTML.

False

71
New cards

T/F - NodeJS uses the same Javascript engine as Chrome.

True

72
New cards

T/F - You can create a basic NodeJS server without any Node modules.

False

73
New cards

T/F - Artificial Intelligence (AI) is a subset of Machine Learning (ML).

False

74
New cards

Which of the following is used for unsupervised learning?

K nearest neighbor (KNN)

Support Vector Machine (SVM)

K-means clustering

75
New cards

Select all that are related to supervised learning

k-nearest neighbors (KNN)

76
New cards

Which is the python package used for machine learning?

gmplot

urllib.request

flask

matplotlib

scikit-learn

77
New cards

T/F - A CAPTCHA is a Turing test

True

78
New cards

The common elements of an algorithm are:

Input, computation, selection, iteration, output, variables

79
New cards

Which of the following is not true about cognitive fluidity:

it is a collision of rationality and intuition leading to counterproductive behaviors in problem-solving activities.

80
New cards

A popular one-way algorithm for encrypting password is:

rainbow tables

private key generation

salt

RSA

SHA-256

81
New cards

Which of the following is not a principles behind the Agile Manifesto:

Welcome changing requirements

Reflect on how to become more effective regularly

Deliver working software frequently

Develop in isolation from business people < ------

82
New cards

Which of the following is not true of a distributed version control system?:

Facilitates collaboration between people

Requires there be only one copy of the repository

83
New cards

What is time complexity of foo()?

def foo(n):

res = 0

i = n

while i > 1:

i = i/2

res += i

return res

O(log n)

84
New cards

Which of the following would clone a repository, create a blank file and have that file added back on the remote repository

470 git clone https://git.cs.vt.edu/maellis1/example-showing-students.git471 cd example-showing-students/

472 touch blank.txt

473 git add blank.txt

474 git commit -m "just adding a file"

475 git push