APCSP Midterm Exam Review (More questions rather than vocab)

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What is the 4-bit binary number for the decimal number Ten (10)?

1010

Choose the answer that is NOT a feature of Public Key Cryptography

A Public Key database ensures 3rd party accountability of security

What is API?

Application Program Interface

Which of the following is made up of 128 bits?

IPv6 address

Private Key

In an asymmetric encryption scheme the decryption key is kept private and never shared, so only the intended recipient has the ability to decrypt a message that has been encrypted with a public key

How does a computer resolve a domain name into an IP address?

It asks a DNS server for the corresponding IP address

What is lossy data compression?

It is a form of data compression that reduces the data file size with an acceptable loss of data information. It does not allow the original file to be restored.

What is lossless data compression?

It is a form of data compression that reduces the data file size without any of loss of data information. It allows the original file to be restored.

What is the best explanation for why digital data is represented in computers in binary?

It's easier, cheaper, and more reliable to build machines and devices that only have to distinguish between binary states.

Which of the following most accurately describes Moore's Law:

Moore's Law is the observation that computing power tends to double every two years

When programmers work together, what is an example of how abstraction in programming can promote collaboration?

Programmers can use functions created by their partners, relying on the functionality without needing to know the specific detail of how the function is implemented

Which of the following statements best describes the properties of public key encryption?

Public key encryption is an encryption method which relies on separate keys for encrypting and decrypting information.

Which of the following is a suite of protocols and programs that support low-level network communication?

TCP/IP

Which of the following terms is synonymous with the term data transfer rate?

bandwidth

The various protocols in use on the internet are said to operate in layers in which the protocol(s) at each layer solve one problem related to networked communication, and higher layers are built on top of, and rely on, the lower layers to do their jobs. From the list provided choose the two (2) answers that correctly describe which internet protocol relies on the other. For example: if protocol A relies onprotocol B, it means that A is a higher level protocol than B, and thus protocol B must exist and work properly in order for protocol A to do its job. Select two answers.

1) DNS relies on TCP/IP 2) HTTP relies on TCP/IP

consider the following four binary numbers 11100111 , 10101010, 11110000, 11001100 which of the following displays the numbers in the ascending order?

10101010 , 11001100 ,11100111, 11110000

Select the answer that lists the units of bytes in ascending order (from smallest to largest)

Kilobyte, Gigabyte, Terabyte

Which audio format is the most popular today?

MP3

Why are parameters useful when programming?

Parameters allow for more flexible, generalized behaviors in functions.

A programmer is writing a system that is intended to be able to store large amounts of personal data. As the programmer develops the data system, which of the following is LEAST likely to impact the programmer's choices in designing the structure of the system?

The frequency of a particular item occurring in a data set.

What is the lowest base in which the number 10 could be a valid number?

binary

Which of the following will call the function drawStar?

drawStar();

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing a hexagon (six-sided shape)

loop

The following question uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the bottom left square of the grid and facing right. Consider the following code segment, which moves the robot in the grid. Which of the following shows the location of the robot after running the code segment?

(A) - pointer is facing down in center of grid

The program segment below is intended to move a robot in a grid to a gray square. The program segment uses the procedure GoalReached, which evaluates to true if the robot is in the gray square and evaluates to false otherwise. The robot in each grid is represented as a triangle and is initially facing left. The robot can move into a white or gray square, but cannot move into a black region. For which of the following grids does the program NOT correctly move the robot to the gray square?

(D) -gray square is in top left corner and top looks like a T

Pick the two expressions involving the Modulo operation that compute to the exact same value (choose 2)

1 mod 16 9 mod 8

Which of the following statements are true about routers and routing on the Internet. Choose two answers.

1) A packet traveling between two computers on the Internet may be rerouted many times along the way or even lost or "dropped". 2)Routers act independently and route packets as they see fit.

Programming languages have some similarities and differences to the "natural" language you use in everyday speech. Select the two true statements about programming languages:

1) Compared to the number of words in a natural language, the number of dened words in a programming language is very small. 2)Ambiguities in natural language necessitate the creation of programming languages for controlling a computer

Select the two true statements about functions with parameters:

1) Parameters help generalize the solution of a specic problem. 2) Functions with parameters can be used to prevent the creation of duplicated code.

Approximately how much bigger (how many more bytes) is a megabyte than a kilobyte?

1,000 times bigger

Which number represents the value of the base in every number system?

10

Consider the following three numbers 10100(base 2), 123(base 10), d7(base-16) which of the following displays the numbers in ascending order?

10100, 123, d7

if the decimal number 89 represents ASCII character Y, what binary number is used to store ASCII character Q?

1010001

what is the modulo of 15 MOD 17 ?

15

Graphics images are stored as two dimensinal arrays of pixels. Many use 24-bits of memory space for each pixel. This is further divided up into three 8-bit sequence s that stores the RGB (RED, GREEN , BLUE) value of each pixel. if 24-bits are used for one pixel and this pixel's color is determined by the three Red, Green and Blue value, each using 8-bits, how many differenct color combination exitst for a pixel?

16,777,216

How many digits are there in the binary number system?

2

What is the modulo of 257 MOD 59 =

21

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

Two students have developed a protocol in which they send 4-bit messages to each other. They decide to modify their protocol to start sending 8-bit messages instead. How many more values can be represented in an 8-bit message than a 4-bit message?

2^4= 16 times as many values

What is the minimum number of bits needed to represent 6 things?

3

The world is currently in a transition to using IPv6, a newer version of the IP protocol that uses 128-bit addresses instead of 32-bit addresses used by IPv4. What is the main problem that IPv6 was created to solve?

32-bit addresses could not ensure that every internet-connected device can receive a unique IP address

How many bytes are required to encode an image that is 25 pixels wide and 50 pixels tall, if you encode each pixel with 24 bits of RGB data?

3753

What is the largest digit in the octal number system?

7

How many things can be represented using three bits?

8

8 bits is enough to represent 256 different numbers. How many total bits do you need to represent 512 (twice as many) numbers?

9 bits

A computer program is orginally designed to store customer identification using a 5-bit binary sequence. As the number of unique customers grows the program mest handle a far greater number of identifications than were originally possible. The new program must handlw 10 times the original customer size. Which of the following binary sequence uses the smallest amount of memory and can still handle new requirements?

9-bit binary sequence

Which of the following images represents the most likely output produced by the code segment given below? (i cant put pic but heres code) for (var i=0; i<15; i++) { moveForward(randomNumber(15,75)); turnRight(90); }

A - pointer is facing left and beneath the drawing

What is one important naming convention of functions?

A function name should be as descriptive as possible to indicate what the function does.

The Internet Engineering Task Force (IETF) defines the protocols and standards for how the Internet works. The members of the IETF are:

A loosely organized collection of citizens and engineers.

High Level Programming Language

A programming language with many commands and features designed to make common tasks easier to program. Any high level functionality is encapsulated as combinations of low level commands.

What is the function parameter?

A way to give input to a function that controls how the function runs

A middle school is expanding to open a high school next year, doubling the total number of students. The school keeps a database in which each student's unique ID number is stored as an 8 bit number called studentID. Before the arrival of the new students almost every 8 bit number has already been assigned to a student. Of the options provided below, which is the smallest change to the way studentID is represented necessary to ensure each incoming student receives a unique ID?

Add a bit to studentID to double the number of IDs that the database can represent.

What is a Distributed Denial of Service (DDoS) attack?

An attempt to compromise a single target by flooding it with requests from multiple systems

Lisa is looking through papers left behind by some students after her class one day. She finds a scrap of paper with strange letter series on it. What word best describes what Lisa is looking at? Efn zj kyv...

Ciphertext

Two students working on a project together don't want any of their classmates to be able to read their notes. In the course of their research, they come across the concept of a Caesar Cipher. In a Caesar CIpher letters are shifted a certain number of spaces down the alphabet. For example, if "c" represents "a", this would indicate a shift of two. The team's notes look like chaos to anyone who finds them, but can be decoded perfectly by reversing the shift. A Caesar Cipher is an example of which kind of encryption?

Correct Answer: Symmetric Encryption

Social media companies, like Facebook, lower picture quality of high reslotion images before posting them on the Internet. Why is this an acceptable practice?

D. All of the above

consider the following four hexadecimal numbers 7B3D2A, FEDCB, 11A2B, A7BC26 Which of the following displays the numbers in descending order?

FEDCB, A7BC26,7B3D2A,11A2B

An artist makes an RGB raster image in which each pixel color is encoded with 12-bits --- 4 bits each for red, green and blue. Which of the following correctly shows the hexadecimal value for Red as a 12bit representation.

FOO

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing out the letters of a word "HELLO"

Function(s)

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

I only

Consider the following incorrect program, which is intended to move the robot around the perimeter of a grid, as indicated by the drawing below. The starting position and direction of the robot is indicated in the diagram. Line 1: REPEAT 4 TIMES Line 2: { Line 3: MOVE_FORWARD() Line 4: ROTATE_RIGHT() Line 5: MOVE_FORWARD() Line 6: MOVE_FORWARD() Line 7: MOVE_FORWARD() Line 8: MOVE_FORWARD() Line 9: ROTATE_RIGHT() Given the options below, which lines should be removed so the program will work as intended?

Line 3 and Line 4

Which of the following BEST describes how protocols on the Internet (e.g. IP, TCP, HTTP) make use of abstraction to accomplish their respective purposes?

Low level protocols can provide functionality to high level protocols without revealing the details of how this is accomplished

SSL/TLS

Secure Sockets layer / Transport Layer Security - An encryption layer of HTTP that uses public key cryptography to establish a secure connection.

Number systems with different bases such as binary (base-2) and decimal (base-10) are all used to view and represent digital data. Which of the following is NOT true about representing digital data?

Some large numbers cannot be represented in binary and can only be represented in decimal.

Fill in the blank of the following statement: "______ encryption is a method of encryption involving one key for both encryption and decryption."

Symmetric

Which of the following breaks messages into packets, hands them off for delivery, and then orders and reassembles them at their destination?

TCP

Which of the following is NOT true about TCP/IP packets?

TCP guarantees that no packets are ever dropped

What is the most likely outcome of running the code shown below? drawStar(0); function drawStar(points){ for (var i=0; i<points; i++){ moveForward(150); turnRight(180-180/points);} }

The program will run without error, but will not draw anything.

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

Bandwidth is the number of bits or bytes that can be transmitted from one place to another in a fixed amount of time.

True

Information is data that has been organized and/or processed in a useful way.

True

Which of the following statements about writing functions and Top-Down Design is NOT true?

Two programmers solving the same problem using Top-Down Design should arrive at identical programs.

Public Key Encryption

Used prevalently on the web, it allows for secure messages to be sent between parties without having to agree on, or share, a secret key. It uses an asymmetric encryption scheme in which the encryption key is made public, but the decryption key is kept private.

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

A school starts tracking which websites each computer in the school is visiting by monitoring the packets leaving the school. A sample of the information they have collected appears below: Which of the following is MOST likely to be answerable using all the data collected by this monitoring?

Which websites are most frequently visited before and after school hours from a school computer

A coffee shop is considering accepting orders and payments through their phone app and have decided to use public key encryption to encrypt their customers' credit card information. Is this a secure form of payment?

Yes, public key encryption is built upon computationally hard problems that even powerful computers cannot easily solve.

Which of the following scenarios is most characteristic of a phishing attack.

You get an email from the IT support desk that asks you to send a reply email with your username and password to verify your account

encryption

a process of encoding messages to keep them secret, so only "authorized" parties can read it.

Decryption

a process that reverses encryption, taking a secret message and reproducing the original plain text

According to the domain name system (DNS), which of the following is a subdomain of the domain example.com?

about.example.com

Random Substitution Cipher

an encryption technique that maps each letter of the alphabet to a randomly chosen other letters of the alphabet.

Which of the following blocks is least similar to the others? a.dot(radius) b. penWidth(width) c. penUp() d. arcLeft(angle,radius)

arcLeft(angle,radius)

onsider the following four numbers 101010(base 2), 43(base 10),101100 (base 2), 37( base 10) which of the following displays the numbers in descending order?

d. 101100(base 2) 43(base 10) 101010 (base 2) 37( base 10) This

What is the lowest base in which the number 987 could be a valid number?

decimal

The colors of the pixels in a digital image are often represented by red, green, and blue values between 0 and 255 (an RGB triplet). A photographer is manipulating a digital image to lighten it because all of the RGB values in the image are less than 100, making it very dark. He does this by adding 20 to the R, G, and B values of each pixel, then overwriting the original image. What type of transformation is the photographer using on the digital image?

lossless transformation

A raw digital sound file samples a sound wave at some interval and measures the height of the wave at each point. Thus, raw sound is recorded as a list of numbers. In very broad terms the MP3 audio compression algorithm identifies frequencies and volume levels - low and high - that are outside the range of human hearing and removes the data representing these frequencies from the original. This technique results in a smaller audio file that sounds exactly the same to the human ear This technique is an example of what type of compression?

lossy compression

The image below shows an encoding for a black and white pixel image. The first two bytes of the data (circled in red) are used to encode the width and height of the image. What is the best term for this type of "data about the data"?

metadata

How is it possible to reduce data file in size for compression and then restore it to its original format without any loss of information?

repetitive data, like color on an image, can be stored with a formula

Which of the following indicates the general type of an organization or a country of origin?

top-level domain

Which of the following blocks is least similar to the others? a. moveTo(x,y) b. arcRight(angle,radius) c. turnLeft(angle) d.moveForward(pixels)

turnLeft(angle)

Which one of the following statements about functions is TRUE

two functions in a single program can have different names but contain identical code

Asymmetric Encryption

used in public key encryption, it is scheme in which the key to encrypt data is different from the key to decrypt.

What is now the primary reason for compressing data?

limited network bandwidth

The next two questions use a robot in a grid of squares. The robot is represented as a triangle, which is initially facing up, towards the top of the grid. The robot is moved according to the following instructions. Instruction Explanation MOVE_FORWARD()The robot moves one square forward in the direction it is facing. ROTATE_RIGHT() The robot rotates in place 90 degrees clockwise (i.e., makes an in-place right turn). ROTATE_LEFT() The robot rotates in place 90 degrees counterclockwise (i.e., makes an in-place left turn). REPEAT n TIMES The block of instructions contained between the braces { } is repeated n times. Consider the following program which uses commands from the pseudocode described above. REPEAT 4 TIMES { MOVE_FORWARD() MOVE_FORWARD() MOVE_FORWARD() ROTATE_RIGHT() MOVE_FORWARD() ROTATE_RIGHT() MOVE_FORWARD() ROTATE_RIGHT() } Which of the following images shows the path and ending location of the robot that will result from executing the code above. The starting location of the robot is shown as dotted triangle for cases where the robot does not start and end at the same location.

e - 5 squares - one on each corner, one in middle - pointer on bottom right square facing forward

A prgrammer completes the use manual for a video game she has developed and realized she has reversed the roles of goats and sheep throughout the text. Consider the programmer's goal of changing all occurrences of " goat" to " Sheep" and all occurences of "sheep" to "goats", The programmer will use the fact that the word " foxes" does not applear 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"

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing a circle of any size at any point on the screen

function(s)

Which of the following is NOT true about functions in programming?

functions cannot make calls to other functions within the same program

what is metadata?

it is data about data, such as file size, data format, creation date, etc

Which of the following is true about representing color as an RGB value?

it mimics the way color is perceived by the human eye

A compression scheme for long strings of bits called run-length encoding is described as follows: Rather than record each 0 and 1 individually, instead record "runs" of bits by storing the number of consecutive 1s and 0s that appear. Since it's binary, any run of 0s must be followed by a run of 1s (even if the run is only 1-bit long) and vice versa. Thus, you can store a list of small numbers that represents the alternating runs of 0s and 1s. Here is an example: To uncompress the data back into its original binary state, you simply reverse the process. This technique is an example of what type of compression?

lossless compression


Kaugnay na mga set ng pag-aaral

Alterations in Endocrine Function

View Set

Physical Science Lesson 6 and Quiz 6

View Set

RN Nursing Care of Children Online Practice 2019 A with NGN

View Set

ENG 111: Grammar Set #1 - Run-ons and Comma Splices

View Set

MGT 301 Exam 3 Practice Questions

View Set