Absolute Bruh Moment CompSci Semester 1 Exam Review

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Sukhada is working on a digital photography project and noticed that the color of the grassy field in her photo is the wrong shade of green. To create the correct shade of green, her teacher has recommended the following primary color proportions... Twice as much Blue as Red Twice as much Green as Blue Which color number satisfies the teacher's recommended proportions?

#238C46

Nandita is working on a digital photography project and noticed that the color of the soccer field in her photo is the wrong shade of green. To create the correct shade of green, her teacher has recommended the following primary color proportions... Twice as much Blue as Red Twice as much Green as Blue Which color numbers satisfy the teacher's recommended proportions?

#3CF078 #1A6834

The code fragment below is intended to display "odd" if the positive number num is odd. IF (<MISSING CONDITION>){ DISPLAY "odd" }

(num MOD 2) = 1

An office building has two floors. A computer program is used to control an elevator that travels between the two floors. Physical sensors are used to set the following Boolean variables. VariableDescriptiononFloor1set to true if the elevator is stopped on floor 1; otherwise set to falseonFloor2set to true if the elevator is stopped on floor 2; otherwise set to falsecallTo1set to true if the elevator is called to floor 1; otherwise set to falsecallTo2set to true if the elevator is called to floor 2; otherwise set to false The elevator moves when the door is closed and the elevator is called to the floor that it is not currently on. Which of the following Boolean expressions can be used in a selection statement to cause the elevator to move.

(onFloor1 AND callTo2) OR (onFloor2 AND callTo1)

Machine language is...

...a sequence of bits.

Data leaks ...

...are a primary target of identity thieves.

The innovation of the Internet...

...began as a government and university project called ARPANET.

Computers are...

...fast.

A computer's main unit...

...is also called the central processing unit

Libel tourism...

...is used to inhibit free speech.

RAM, or random access memory, ...

...is volatile.

Moore's Law...

...states that computing capacity doubles every couple of years.

Some programming languages use constants, which are variables that are initialized at the beginning of a program and never change. Which of the following are good uses for a constant? 1) To represent the mathematical value (pi) as 3.14 2) To represent the current score in a game 3) To represent a known value such as the number of days in a week

1 & 3

Which of the following are true statements about digital certificates in Web browsers? 1) Digital certificates are used to verify the ownership of encrypted keys used in secured communication. 2) Digital certificates are used to verify that the connection to a Web site is fault tolerant.

1 only

According to Blown to Bits, koans...

1) ...are truths about bits. 2) ...provoke meditation and enlightenment. 3) ...are oversimplifications. 4) All of the above. <--Correct Answer

Substitution Ciphers...

1) were used in an astronomical text by the English poet Geoffrey Chaucer. 2) are often 'cracked' using frequency analysis. 3) were employed by Mary Queen of Scots in a plot against Queen Elizabeth I. 4) All of the above are true. <---this is the right answer

Which of the following statements are true about using a high-level programming language instead of a lower-level language? 1) Programs written in a high-level language are generally easier for people to read than programs written in a low-level language. 2) A high-level language provides programmers with more abstractions than a low-level language. 3) Programs written in a high-level language are generally easier to debug then programs written in a low-level language.

1, 2, & 3

What is the value of the JavaScript expression 7 + 3 ?

10

The field of Computer Science was developed in the _____.

1940s

What is the value of the JavaScript expression 14 % 4 ?

2

An online store uses 6-bit binary sequences to identify each unique item for sale. The store plans to increase the number of items it sells and is considering using 7-bit binary sequences. Which of the following best describes the result of using 7-bit sequences instead of 6-bit sequences?

2 times as many items can be uniquely identified

Consider the following code segment, which uses the variables r, s, and t. r = 1 s = 2 t = 3 r = s s = t DISPLAY (r) DISPLAY (s) What is displayed as a result of running the code segment?

2, 3

A video streaming Web site uses 32-bit integers to count the number of times each video has been played. In anticipation of some videos being played more times than can be represented with 32 bits, the Web site is planning to change to 64-bit integers for the counter. Which of the following best describes the result of using 64-bit integers instead of 32-bit integers?

2^32 times as many values can be represented.

How many bits are used in the address of an IPv4 packet?

32

Consider the following compound Boolean expression: ( num ≠ 3 ) AND ( num ≠ 4 ) AND ( num ≠ 5 ) For which of these values of num is the expression false?

4

Which of the following has the greatest potential for compromising a user's personal privacy?

A group of cookies stored by the user's Web browser

Which of the following is true about binary collections?

A terabyte is greater than a megabyte.

In order to manage complexity, programmers often create a function or procedure which combines several programming statements. This is an example of what programming concept?

Abstraction

A computer program uses 3 bits to represent integers. When the program adds the decimal (base 10) numbers 5 and 3, the result is 0. Which of the following is the best explanation for the result?

An overflow error occurred.

A computer program uses 3 bits to represent integers. When the program adds the decimal (base 10) numbers 5 and 3, the result is 0. Which of the following is the best explanation for the result?An overflow error occurred.

An overflow error occurred.

The procedure Draw (length, direction) is used to draw a line segment length units long in a given direction (left, right, up, or down), starting at the current cursor position. The cursor is then repositioned at the end of the line segment that was drawn. Consider the following program, where the cursor starts in the upper left corner of a grid of dots. The dots are spaced one unit apart. Draw (1, right) Draw (2, down) Draw (1, left) Draw (1, right) Draw (1, up) Draw (1, left) Which of the following represents the figure that is drawn by the program?

Backwards E

Consider the following code segment below. IF (onTime){ DISPLAY "Hello." } ELSE{ IF (absent){ DISPLAY "Is anyone there?" } ELSE{ DISPLAY "Better late than never." } } If the variables onTime and absent both have the value false, what is displayed as a result of running the code segment?

Better late than never.

Which set of numbers contains equivalent values?

Binary 1110, Hexadecimal E, Decimal 14

There are 32 students in a classroom. Two different algorithms are given for finding the average height of the students. Algorithm A Step 1: All students stand. Step 2: A randomly selected student writes his or her height on a card and is seated. Step 3: A randomly selected standing student adds his or her height to the value on the card, records the new value on the card, and is seated. The previous value on the card is erased. Step 4: Repeat step 3 until no students remain standing. Step 5: The sum on the card is divided by 32. The result is given to the teacher. Algorithm B Step 1: All students stand. Step 2: Each student is given a card. Each student writes his or her height on the card. Step 3: Standing students form random pairs at the same time. Each pair adds the numbers written on their cards and writes the result on one student's card; the other student is seated. The previous value on the card is erased. Step 4: Repeat step 3 until one student remains standing. Step 5: The sum on the last student's card is divided by 32. The result is given to the teacher. Which of the following statements is true?

Both Algorithm A and Algorithm B always calculate the correct average.

Consider the code segment below. Line 1: IF (a = 0) Line 2: { Line 3: b a + 10 Line 4: } Line 5: ELSE Line 6: { Line 7: b a + 20 Line 8: } Which of the following changes will NOT affect the results when the code segment is executed?

Changing line 3 to b = 10

Which of the following is the best example of sequencing?

Code will start at line 1, then execute line 2, then line 3, and so on, until it reaches the last line of the program.

Consider the following numbers. Binary 1100 Decimal 11 Hexadecimal D Which of the following lists the numbers in order from least to greatest?

Decimal 11, Binary 1100, Hexadecimal D

Which of the following is true about EDRs (Event Data Recorders)?

EDRs are installed in most airplanes, sometimes called 'black boxes.'

A programmer completes the user manual for a video game she has developed and realized she had reversed the roles of goats and sheep throughout the text. Consider the programmer's goal of changing all occurrences of "goats" to "sheep" and all occurrences of "sheep" to "goats." The programmer will use the fact that the word "foxes" does not appear anywhere in the original text. Which of the following algorithms can be used to accomplish the programmer's goal?

First, change all occurrences of "goats" to "foxes."Then, change all occurrences of "sheep" to "goats."Last, change all occurrences of "foxes" to "sheep."

do their jobs, and higher layers (higher level of abstraction) are built on top of the lower layers (lower level of abstraction). From the list provided choose the two (2) answers that correctly describe the relative levels of abstraction of the internet protocols. For example: if protocol A relies on protocol B, it means that A is a higher level of abstraction than B.

HTTP is a higher level of abstraction than TCP/IP DNS is a higher level of abstraction than TCP/IP

Consider the following procedure: PROCEDURE min (num1, num2, num3) { <missing code> } The procedure min is intended to return the smallest of three numbers. Which of the following is a replacement for <missing code> so it works as intended?

IF ((num1 < num2) AND (num1 < num3)) { RETURN num1 } ELSE { IF ((num2 < num1) AND (num2 < num3)) { RETURN num2 } ELSE { RETURN num3 } }

Select the two options that are factually correct about IPv4 and IPv6 addresses. Select two answers.

IP stands for Internet Protocol IPv4 uses 32-bit addresses and IPv6 uses 128-bit addresses

Select the two options that are factually correct about IPv4 and IPv6 addresses. Please select two answers.

IP stands for Internet Protocol IPv4 uses 32-bit addresses and IPv6 uses 128-bit addresses

Internet Protocol version 4 (IPv4) uses a 32 bit binary number to represent an IP address. Internet Protocol version 6 (IPv6 ) uses a 128 bit binary number to represent the same. Which one of the following BEST describes the reason for this changeover in IP address representation?

IPv6 allows for 2^96 times more IP addresses. This will ensure that we will have enough IP addresses to handle the exponential demand for future IP addresses.

The figure below shows a circuit composed of two logic gates. The output of the circuit is true. *Picture where there are two inputs, false and A, go into an or statement that goes into another dual output with whatever comes from original to an And statement with one side already true. Which of the following is a true statement about input A?

Input A must be true.

What ASCII character is represented by the binary (base 2) number 1001010 ?

J

Which is the following is required when correcting compilation errors.

Knowledge of the programming language.

Values that are keyed directly into source code are called ____.

Literals

Which of the following Boolean expressions are equivalent to the expression num 15 ? Select two answers.

NOT (num < 15) (num > 15) OR (num = 15)

Which of the following is NOT a true statement about an IP address?

Not every digital device connected to the Internet needs an IP address to pinpoint its location and to differentiate it from other devices.

In the program below, the initial value of x is 5 and the initial value of y is 10. IF (x < 0){ DISPLAY ("Foxtrot") }ELSE{ IF (x > y){ DISPLAY ("Hotel") }ELSE{ IF (y > 0){ DISPLAY ("November") }ELSE{ DISPLAY ("Yankee") } } } What is displayed as a result of the running program?

November

Which of the following is a true statement about program documentation?

Program documentation is useful during initial program development and also when modifications are made to existing programs.

Often programs are expressed in a programming language. Which of the following is also true of programs?

Programs can be expressed as machine code, but programs are more easily understood by humans when expressed in a higher-level programming language.

Two students are playing Battleship on the Internet and are having trouble coordinating their moves. What should the students use to improve their communication?

Protocol

Which of the following is considered an unethical use of computer resources?

Purchasing a single-user copy of photo editing software and installing it on all the computers in a computer lab

Which of the following are advantages of using procedures? Select two answers.

Reduced debugging time Reduced coding time

What is the term used to describe a network system in which many paths exist between any two devices?

Redundancy

____ operators are used to compare two values.

Relational

Historically, it has been observed that computer processing speeds tend to double every two years. Which of the following best describes how technology companies can use this observation for planning purposes?

Technology companies can set research and development goals based on anticipated processing speeds.

The code segment below is intended to swap the values of the variables first and second using a temporary variable, temp. <Missing Code> First <-- Second Second <-- Temp Which of the following can be used to replace < MISSING CODE > so the code segment works as intended?

Temp <-- First

According to Blown to Bits, what is true about the 8th koan?

The 8th and 9th koans are essentially the same.

Which of the following can be represented by a single binary digit? Select two answers.

The answers to a True/False question The value of a Boolean variable

What is the difference between the encryption key and the decryption key in a symmetric key encryption system?

The keys are identical.

Which of the following is true about number system conversions?

The number base equals the amount of its number symbols.

A program is expressed in a programming language. Which of the following is true of the program?

The program can also be expressed as binary code, but will be more easily understood by humans when expressed in a higher-level programming language.

Which of the following are benefits of using well-named variables in a computer program? Select two answers.

The program will be easier for people to read. The program will be easier to modify in the future.

Which of the following are benefits of using well-named variables in a computer program? Select two answers.

The program will be easier to modify in the future. The program will be easier for people to read.

A student is recording a song on her computer. When the recording is finished, she saves a copy on her computer. The student notices that the saved copy is of lower sound quality than the original recording. Which of the following could be a possible explanation for the difference in sound quality?

The song was saved using fewer bits per second than the original song.

A school library allows students to borrow laptops. A computer program is used to count the number of times a particular laptop has been borrowed from the library (borrows) and the number of times the same laptop has been returned to the library (returns). Which of the following indicate that a particular laptop is not currently borrowed? Select two answers.

The sum of borrows and returns is a positive even number. The difference between borrows and returns is zero.

Which of the following can be represented by a single binary digit?

The value of a Boolean variable The remainder when dividing a whole number by 2

Which of the following is a true statement about data compression?

There are trade-offs involved in choosing a compression technique for storing and transmitting data.

Which of the following statements is true?

There exist problems that no algorithm will ever be able to solve for all possible inputs.

The Internet Engineering Task Force is a large open international community of network designers, operators, vendors, and researchers concerned with the evolution of the Internet architecture and the smooth operation of the Internet. Which of the following is NOT one of its responsibilities?

To close the Digital Divide between those who have access to cutting-edge communication services and those who do not

What is the primary function of the Internet?

To connect devices and networks all over the world.

What is the primary reason program components are documented?

To maintain and develop programs with the assistance of other developers

The system of codes that the computer uses to represent characters is called ______.

Unicode

ASCII characters can also be represented by hexadecimal numbers. According to ASCII character encoding, which of the following letters is represented by the hexadecimal (base 16) number 56?

V

Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem?

When the problem cannot be solved in a reasonable time and an approximate solution is acceptable

The following code segment is intended to display a randomly generated integer between 1 and 100 and whether it is even or not even. a ← RANDOM (1,100) DISPLAY (a) IF ( <MISSING CODE> ) { DISPLAY ("This integer is even") } ELSE { DISPLAY ("This integer is not even") } Which of the following could replace <MISSING CODE> so that the code segment works as intended?

a MOD 2 = 0

A finite sequence of steps designed to solve a problem is called a(n) _________.

algorithm

Complete the following sentence: A(n) ______________ is a set of steps we follow to complete a task while a(n) ____________ is a procedure intended to provide a reasonable, though not necessarily best, solution.

algorithm, heuristic

JavaScript identifiers...

are used to name a portion of computer memory.

The program used to translate assembly language into machine language is called the ___________.

assembler

Biometric data...

could be collected by an airport security scan.

Trudy is writing a program to input student grades from a particular test. It will also use the variable count to keep track of the number of times a user enters the particular score of 85. Of the steps below, which should appear earliest in her pseudocode?

count <--0

In a flowchart, the ____ symbol is used to indicate that a decision needs to be made.

diamond

What is the value of the JavaScript expression myAge > 17 && myAge <= 17 ?

false

What's the value of the JavaScript expression myShoeSize <= yourShoeSize && myGPA != yourGPA ?

false, if my feet are bigger than yours

A(n) ____ uses symbols and shapes connected by lines to illustrate the steps of a program.

flowchart

The diagram below shows a circuit composed of two logic gates labeled OR and AND. Each gate takes two inputs and produces a single output. *The diagram is two variables A and B going into an or statement. This or statement goes into an And statement with variable C* If the inputs A and C are both true, which of the following best describes the output of the AND gate?

he output will be true no matter what the value of input B is.

The algorithm below is used to simulate the results of flipping a coin 4 times. Consider the goal of determining whether the simulation resulted in a equal number of heads and tails. Step 1: Initialize the variables heads_counter and flip_counter to 0. Step 2: A variable coin_flip is randomly assigned a value of either 0 or 1. If coin_flip has the value of 0, the coin flip result is heads, so heads_counter is incremented by 1. Step 3: Increment the value of flip_counter by 1. Step 4: Repeat steps 2 and 3 until flip_counter equals 4. Following execution of the algorithm, which of the following expressions indicates that the simulation resulted in an equal number of heads and tails?

heads_counter = 2

JavaScript variables...

must adhere to identifier guidelines.

JavaScript expressions...

must evaluate to a value

Central High School keeps a database of information about each student, including the numeric variables numberOfAbsences and gradePointAverage. The expression below is used to determine whether a student is eligible to receive an academic award. (numberOfAbsences 5) AND (gradePointAverage > 3.5) Which of the following pairs of values indicates that a student is eligible to receive an academic award?

numberOfAbsences = 5, gradePointAverage = 3.8

What is the value of the JavaScript expression myAccountBalance + distanceToNearestStar ?

potentially, any real number

Given the variable name assigned a string literal "ABRAHAM", which of the following JavaScript statements would display the name correctly capitalizing the first letter only? Select two answers.

print(name[0] + name.slice(1).toLowerCase()); print(name[0] + name.substr(1, name.length-1).toLowerCase());

The explosion of bits in our society has led to issues of...

privacy

In the process of digging, a landscaping company cuts a fiber line. Transmission of Internet traffic is still possible through additional pathways that provide alternate routes between the source and destination. The additional pathways describe a concept known as:

redundancy

A ____ error is any error that occurs when the program is running.

run-time

A code segment will be used to swap the values of the variables a and b using a temporary variable temp. Which of the following code segments correctly swaps the values a and b?

temp = a a = b b = temp

What is the value of the JavaScript expression -4 < 1 ?

true

What is the value of the JavaScript expression 23 < 1 | | 12 > 6 ?

true

What is the value of the JavaScript expression myAge > 17 ?

true, for adults

What is the value of the JavaScript expression myShoeSize <= yourShoeSize ?

true, if your feet are at least as big as mine

The function header is defined below. Choose the three lines of code that will perform the swap correctly procedure swap (list, x, y) { <MISSING CODE> }

var temp ← list[y]; list[y] ← list[x]; list[x] ← temp;

What is the value of the JavaScript expression myGPA - 0.5 ?

within the range -0.5 to 4.5


संबंधित स्टडी सेट्स

chapter 10 and 11.3 history test

View Set

Frankenstein study guide letters + Ch 1 - 2

View Set

Ch 23 Covalent Bonding and Intermolecular Interactions

View Set

Triangle Congruence: ASA and AAS (100%)

View Set

Med Surg Exam #2 FA Davis Questions

View Set