Vanessa study guide

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

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

A. 9 MOD 8 B. 1 MOD 16

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

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

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

A. Symmetric

Study the code segment below to see what it will output. Values of x and y will be displayed multiple times during the running of the program, and you might recognize a pattern. From the list of possible outputs listed two (2) are IMPOSSIBLE. Choose the two (2) outputs that are impossible for this code to produce. x <- 0 REPEAT_UNTIL( x = 3 ){ y <- 0 x <- x+1 REPEAT_UNTIL ( y = 3 ){ y <- y+1 DISPLAY( x + ", " + y) } } NOTE: if the condition is TRUE the loop does not execute. For example if x is currently 3 then REPEAT_UNTIL (x=3) will not execute. A. 0, 0 B. 1, 1 C. 2, 4 D. 2, 1 E. 2, 2

A. 0, 0 C. 2, 4

What is the output of the following JavaScript code segment? var num = 5; var str = "hello"; var result = num + str; console.log(result); A. 5hello B. 5 + hello C. error on num + str: type mismatch D. result

A. 5hello

8 bits is enough to represent 256 different numbers. How many total bits do you need to represent 512 (twice as many) numbers? A. 9 bits B. 10 bits C. 16 bits D. 17 bits

A. 9 bits

What is APA?

Application Program Interface - A well-documented library of functions provided in a programming language that helps to simplify complex programming tasks.

Consider the following three binary numbers: 01010 010000 1110 Which of the following lists the numbers in order from least to greatest? A. 010000 1110 01010 B. 01010 1110 010000 C. 01010 010000 1110 D. 1110 01010 010000

B. 01010 1110 010000

What is contained in the list data after the following code segment is run? index: 1 / 2 / 3 / 4 / 5 / data: 10/45/38/16/23/ data <- [10, 45, 38, 16, 23] REMOVE(data, 2) REMOVE(data, 3) A. 10/16/23 B. 10/38/23 C. 45/38/23 D. 10/ /38/ /23 E. 10/ / /16/23

B. 10/38/23

What will be displayed as a result of the code below executing? var a = 5; while (a < 5) { a = a - 1; } console.log(a); A. 6 B. 5 C. 4 D. 0 E. Infinite loop

B. 5

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

C. A Public Key database ensures 3rd party accountability of security

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?

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

Consider the JavaScript code segment below. Which statement should be used in place of <missing code> such that the alarm is set to 9:00 am on weekends, and 6:30 am on weekdays? var day = prompt("What day is it tomorrow?"); if ( <missing code>){ setAlarm = "9:00am"; } else { setAlarm = "6:30am"; } A. day == "Saturday" B. day == "Sunday" C. (day == "Saturday") || (day == "Sunday") D. (day == "Saturday") && (day == "Sunday") E. day != "Monday"

C. (day == "Saturday") || (day == "Sunday")

What does the following code segment display? index: 1 / 2 / 3 / 4 / 5 / data: 3/ 5/ 8/ 2 / 1 / data <- [3, 5, 8, 2, 1] REMOVE(data, 3) DISPLAY(data[3]) A. 0 B. 1 C. 2 D. 8 E. Error. Index 3 does not exist.

C. 2

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

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

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

Which of the following statements about strings in JavaScript is FALSE? a. Strings consist of a sequence of concatenated characters. b. Strings with numerical digits in them are invalid. c. Strings are indicated by quote marks. d. A string can be empty, meaning that it contains nothing. e. Strings sometimes include spaces.

b. Strings with numerical digits in them are invalid.

What value will be displayed after the loop has executed? var a = 5; while (a >= 3){ a = a - 1; } console.log(a); A. 5 B. 4 C. 3 D. 2 E. Infinite loop

D. 2

Which of the following are actions a programmer could take when debugging a segment of code that could most likely lead to finding a problem and fixing it? (choose two)

- Display the value of variables at various points during the program. - Ask a friend or collaborator to look over the code segment to see if they are able to find any errors.

Select the two true statements about functions with parameters:

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

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)Ambiguities in natural language necessitate the creation of programming languages for controlling a computer 2)Compared to the number of words in a natural language, the number of defined words in a programming language is very small.

2 things that are true about function

1)Meaningful function names help people better understand programs. 2)Functions in programming are named groupings of programming instructions.

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

1,000 times bigger

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

What is one important naming convention of functions?

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

Short Response: What might a programmer create a global variable instead of a local variable?

A global variable would be created if the variable is used throughout the program and not just in one specific function; ex. score needs to be changed when divided(function)

What is a 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? A. Add a bit to studentID to double the number of IDs that the database can represent. B. Double the number of bits in studentID to double the number of IDs that the database can represent C. Keep using an 8-bit number for studentID but reserve the first bit to indicate middle school or high school. D. Remove a bit from studentID to make room for incoming students

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

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.

A. I only

How does a computer resolve a domain name into an IP address? A. It asks a DNS server for the corresponding IP address B. It scans addresses until it finds the one it's looking for C. It uses a Border Gateway Protocol to get the address from a nearby computer. D. It creates an IP address for the domain, and shares it with the closest DNS.

A. It asks a DNS server for the corresponding IP address

According to the domain name system (DNS), which of the following is a subdomain of the domain example.com? A. about.example.com B. example.co.uk C. example.com.org D. example.org

A. about.example.com

Which of the following is FALSE about element IDs?

An element with a unique ID must always have an event handler associated with it

ASCII is a character-encoding scheme that uses a numeric value to represent each character. For example, the uppercase letter "G" is represented by the decimal (base 10) value 71. A partial list of characters and their corresponding ASCII values are shown in the table below. Decimal ASCII character 65 A 66 B 67 C 68 D 69 E 70 F 71 G 72 H 73 I 74 J 75 K 76 L 77 M 78 N 79 O 80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W 88 X 89 Y 90 Z ASCII characters can also be represented by binary numbers. According to ASCII character encoding, which of the following letters is represented by the 8-bit binary value: 0100 0010 A. ASCII Character: A B. ASCII Character: B C. ASCII Character: D D. The table does not contain the value represented by the binary number 0100 0010

B. ASCII Character: B

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 on protocol 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. A. TCP/IP relies on HTTP B. HTTP relies on TCP/IP C. DNS relies on TCP/IP D. TCP/IP relies on DNS

B. HTTP relies on TCP/IP C. DNS relies on TCP/IP

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? A. High level protocols take into account specific implementation details of lower level protocols to ensure they are compatible. B. Low level protocols can provide functionality to high level protocols without revealing the details of how this is accomplished. C. Low level protocols are written in binary while high level protocols are written in hexadecimal. D. High level protocols can take on the role of a low level protocol in the event of failure in the system.

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

Which of the following is NOT true about TCP/IP packets? A. Packets are numbered so if they arrive out of order the message can be reassembled. B. TCP guarantees that no packets are ever dropped C. Packets can be routed on different paths from sender to receiver. D. Messages are broken into packets to improve reliability of the internet

B. TCP guarantees that no packets are ever dropped

A Boolean expression is an expression that evaluates to which of the following? A. Yes/Maybe/No B. True/False C. Any Integer D.Integers between 1 and 10 E. Any single character

B. True/False

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

B. 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

Consider the code segment below: var a = 0; var b = 3; var c = 4; a = a+c b = a+c c = a+c What are the values of a, b, and c after this code segment has been run? A a=4 b=4 c=4 B a=4 b=8 c=8 C a=4 b=8 c=12 D a=4 b=8 c=16 E a=0 b=3 c=4

B. a:4, b:8, c:8

A statistician would like to simulate rolling a single die until she has rolled the die a total of 100 times, or she rolls a six a total of 25 times, whichever comes first. Which boolean expression should she use for the <missing code> to accomplish this? var rolls = 0; var sixes = 0; while ( <missing code> ){ var nextRoll = randomNumber(1, 6); if(nextRoll == 6) { sixes = sixes + 1; } rolls = rolls + 1; } console.log(rolls); console.log(sixes); A. rolls >= 0 && sixes < 25 B. rolls < 100 && sixes < 25 C. rolls < 100 || sixes < 25 D. rolls = 100 || sixes <= 25 E. rolls < sixes || sixes > 25

B. rolls < 100 && sixes < 25

What is the 4-bit binary number for the decimal number Ten (10)? A. 0010 B. 1010 C. 0110 D. 0101

B.1010

A student decides to draw a series of three dots (sort of like a snowman) as shown in the diagram. She wants each dot to be half the radius of the previous dot, and for the center to be on the edge of the dot below it. She writes the following code segment to do it: 1 var bottom = 100; 2 var middle = 50; 3 var top = 25; 4 5 dot(bottom); 6 moveForward(bottom); 7 8 dot(middle); 9 moveForward(middle); 10 11 dot(top); She is not sure about the size though, and wants to be able to quickly experiment with the drawing by changing only one number the radius of the bottom dot and for the rest of the code to size and scale the drawing accordingly. How should she adjust lines 2 and 3 of her code to implement this change? A. 2 var middle = 100 / 2; 3 var top = 50 / 2; B. 2 var middle = 100 50; 3 var top = 50 25; C. 2 var middle = bottom / 2 ; 3 var top = middle / 2; D. 2 var middle = bottom 50; 3 var top = middle 25; E. 2 var top = middle / 2; 3 var middle = bottom / 2;

C. 2 var middle = bottom/2 ; 3 var top = middle / 2;

What is displayed in the debug console based on the following code segment? var name = "Hello"; console.log( name.length ); A.Hello B.4 C.5 D.name.length

C. 5

What is the minimum number of bits you would need to encode the 26 letters of the alphabet plus a space - a total of 27 characters? A. 2 bits B. 3 bits C. 5 bits D. 6 bits

C. 5 bits

The Internet Engineering Task Force (IETF) defines the protocols and standards for how the Internet works. The members of the IETF are: A. An International coalition of government agencies who oversee the Internet in their countries. B. A collection of the leaders of the Tier 1 Internet service providers. C. A loosely organized collection of citizens and engineers. D. Political leaders and heads of state. E. There are no members. IETF is an "organization" in name only. Answer

C. A loosely organized collection of citizens and engineers.

Which of the following statements are true about routers and routing on the Internet. Choose two answers. A. Protocols ensure that a single path between two computers is established before sending packets over it. B. Routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. C. A packet traveling between two computers on the Internet may be rerouted many times along the way or even lost or "dropped". D. Routers act independently and route packets as they see fit.

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

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

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

The figure represents a network of physically linked computers labeled A through F. A line between two computers indicates that the computers can communicate directly with each other. Any information sent between two computers that are not directly connected must go through at least one other computer. The weight or cost of sending information from one computer to another is indicated by the number above the line. For example, information can be sent directly between computers A, and B and will cost 5. Information sent between computers A and D must go through either computer C (with total cost 5), or through computer B (with total cost 8) https://images.code.org/e4cea982e5881df71e417c2f6d6dc45a-image-1463323561451.png Computer A sends a packet intended to reach computer F. Along its path it arrives at Computer C. Which computer should Computer C forward the packet to in order to use the most cost effective path? A. Computer A B. Computer B C. Computer D D. Computer F

C. Computer D

Which of the following is true about while loops in JavaScript? A. While loops terminate after a fixed number of loops that is pre-determined B. While loops terminate after a fixed number of loops that is determined after the loop executes once. C. While loops run as long as a given boolean condition is true. D. While loops run as long as a given boolean condition is false. E. While loops are known as "forever loops" and never stop until the program is halted by the user.

C. While loops run as long as a given boolean condition is true.

The counter variable in the code below increments by 1 each time through the loop. What will the value of counter be after the following loop executes? var counter = 0; var n = 6; while(n > 0){ n = n - 2; counter = counter + 1; } console.log(counter) A. 0 B. 1 C. 2 D. 3 E. 4

D. 3

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? A. 21 = 2 times as many values B. 22 = 4 times as many values C. 23 = 8 times as many values D. 24 = 16 times as many values

D. 24 = 16 times as many values

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?

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

Assume that a variable temperature is assigned like this: var temperature = 30; Choose the Boolean expression that evaluates to FALSE. A. (temperature > 0) && (temperature < 32) B. (temperature == 0) || (temperature < 32) C. (temperature != 0) && (temperature < 32) D. (temperature == 0) || (temperature > 32)

D. (temperature == 0) || (temperature > 32)

Several questions below refer to arrays in JavaScript and pseudocode. The pseudocode syntax is very similar to JavaScript with the notable exception that in pseudocode the first index in an array is 1. In Javascript the first index is 0. Given the following array, what will the code segment below display after being run? The initial state of the array is shown for you to use as a reference. Index: 1 / 2 / 3 / 4 / 5 / 6 Data: 5/ 8/ 3 / 4 / 2 / 1 data = [5, 8, 3, 4, 2, 1] a <- data[5] b <- data[2] DISPLAY(a + b) A. 4 B. 7 C. 9 D. 10 E. ab

D. 10

What is the output to the console after the following code segment is executed? 1 var x = 10; 2 increase(); 3 x = x+3; 4 console.log(x); 5 function increase(){ 6 var x = 5; 7 } A. 5 B. 8 C. 10 D. 13 E. Error. Cannot make a new variable x inside function increase()

D. 13

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? A. 32-bit addresses could not accommodate the increased size and amount of data traveling on the Internet as it has grown in popularity B. IPv6 will allow problems with IPv4's address hierarchy to be resolved C. IPv4 proved unreliable in some cases where network redundancy could not be ensured D. 32-bit addresses could not ensure that every internet-connected device can receive a unique IP address

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

Consider the following code segment that appends numbers to a list one at a time. data <- [] APPEND (data, 2) APPEND (data, 6) APPEND (data, 9) APPEND (data, 3) APPEND (data, 1) What is the value of data[2] after the code above is executed (Assume indexing begins with 1) A. 1 B. 2 C. 3 D. 6 E. Error. There is no index 2.

D. 6

Tiffany is writing a program to help manage a bake sale. She writes the following code which prompts the user to enter the total number of items a person is buying and then a loop repeatedly prompts for the cost of each item. She wrote the code but there is a problem: it runs in an infinite loop. How can Tiffany change her code so it doesn't loop forever? 0 var numItems = promptNum("How many items?"); 1 var total = 0; 2 while (numItems > 0){ 3 total = total + promptNum("Enter next item price"); 4 } 5 console.log("The total is" + total); A. Change Line 1 to: var total = -1; B. Change Line 2 to: while (itemsInCart >= 0){ C. Change Line 3 to: total = promptNum("Enter next item price"); D. Add after line 3: numItems = numItems - 1; E. Add after line 4: numItems = 0;

D. Add after line 3: numItems = numItems - 1;

A programmer wrote an essay for his history class, and realized he has confused the names of Benjamin Franklin and Alexander Graham Bell. Instead of going through the whole paper and changing the names, he used the following incorrect algorithm in an attempt replace every occurrence of "Benjamin Franklin" with "Alexander Graham Bell" and vise versa: - First, change all occurrences of "Benjamin Franklin" to "apple" - Then, change all occurrences of "apple" to "Alexander Graham Bell". - Then, change all occurrences of "Alexander Graham Bell" to "Benjamin Franklin". Here is an example of one of the sentences from the paper: Alexander Graham Bell was born 141 years before Benjamin Franklin, so he was never able to telephone his neighbors. Which of the following is the result of running the described incorrect algorithm on the sentence above? A. Benjamin Franklin was born 141 years before Alexander Graham Bell, so he was never able to telephone his neighbors. B. apple was born 141 years before Benjamin Franklin, so he was never able to telephone his neighbors. C. Alexander Graham Bell was born 141 years before apple, so he was never able to telephone his neighbors. D. Benjamin Franklin was born 141 years before Benjamin Franklin, so he was never able to telephone his neighbors. E. Alexander Graham Bell was born 141 years before Alexander Graham Bell, so he was never able to telephone his neighbors.

D. Benjamin Franklin was born 141 years before Benjamin Franklin, so he was never able to telephone his neighbors.

Choose the best description of what the mystery procedure below does. The procedure accepts two parameters: a list of a values and a number n. PROCEDURE mystery (list, n) { i = 1 REPEAT LENGTH(list) TIMES { IF ( list[i] = n ) { DISPLAY (i) } i = i+1 } } A. Mystery displays the number at index n. B. Mystery displays the index of the first occurrence of the value n in the list. C. Mystery displays the index of the last occurrence of the value n in the list. D. Mystery displays the index of every occurrence of the value n in the list. E. Mystery displays true if n is in the list.

D. Mystery displays the index of every occurrence of the value n in the list.

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? A. At one of the lowest levels of abstraction, all digital data can be represented in binary using only combinations of the digits zero and one. B. The same value (number) can have a different representation depending on the number system used to represent it. C. Groups of bits can be used to represent abstractions, including but not limited to numbers and characters. D. Some large numbers cannot be represented in binary and can only be represented in decimal.

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

Which of the following is true about the way digital data is transmitted on the Internet? A. Bit-rate (bandwidth) is the time elapsed between the transmission and receipt of a piece of digital data. B. Latency is the amount of data (measured in bits) that can be sent in a fixed amount of time. C. Digital data can only be transmitted between two devices when they are physically connected to one another (for example by a copper wire) D. Two devices must communicate using the same bit-rate to successfully send and receive digital data.

D. Two devices must communicate using the same bit-rate to successfully send and receive digital data.

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: IP Address/Time/URL .../ ... /... 1.1.1.1/11:05:23.22/example.com 1.5.1.8/11:05:29.71/news.com 1.1.5.1/11:06:13.48/sports.com 1.5.1.8/11:08:09.95/example.com .../ ... /... 1.1.5.1/17:04:29.20/news.com Which of the following is MOST likely to be answerable using all the data collected by this monitoring? A. Which students are visiting social media sites from school B. Which classes are assigning the most homework using the computers C. Which programs students are running on the lab computers D. Which websites are most frequently visited before and after school hours from a school computer

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

What is the expected output of the given JavaScriptcode segment? var age =35 IF (age < 35){ DISPLAY (You are not old enough to be President.)} ELSE { DISPLAY (You are old enough to be President!) } A. 35 B. true C. You are not old enough to be President. D. You are old enough to be President!

D. You are old enough to be President!

What is displayed by the console.log statement after the following code segment executes? 1 | var a = 3; 2 | var b = 6; 3 | var c = 10; 4 | a = b / a; 5 | b = c - a; 6 | c = b / a; 7 | console.log("value is: "+c); A. value is: 2 B. value is: 2.3333333 C. value is: 3 D. value is: 4 E. value is: c

D. value is: 4

Which one of the following statements about functions is TRUE

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

What is stored in list data after the following code segment is run? Index: 1 / 2 / 3 / Data: 0/ 1/ 2 / data <- [0,1,2] INSERT(data, 1, 3) INSERT(data, 2, 4) INSERT(data, 3, 5) DISPLAY(data) A. 0/ 1/ 2/ 3/ 4/ 5/ B. 0/ 3/ 1/ 4/ 2/ 5/ C. 3/ 0/ 4/ 1/ 5/ 2/ D. 0/ 1/ 1/ 2/ 3/ 2/ E. 3/ 4/ 5/ 0/ 1/ 2/

E. 3/ 4/ 5/ 0/ 1/ 2/

What is the output of the code segment below? The initial state of the array is shown for you to use as a reference. Index: 1 / 2 / 3 / 4 / 5 / 6 Data: 5/ 8/ 3 / 4 / 2 / 1 i <- 4 a <- data[i] b <- data[i + 1] DISPLAY(a + b) A. 2 B. 3 C. 4 D. 5 E. 6

E. 6

What is the output to the console after the following code segment is executed? 1 fiveMore(); 2 function fiveMore(){ 3 var x = 5; 4 } 5 var y = 3 + x; 6 console.log(y); A. -2 B. 3 C. 5 D. 8 E. Error. Unknown Identifier: x

E. Error. Unknown Identifier: x

What will be displayed as a result of the javascript code below executing? var a = 0; while( a != 5 ){ a = a+2; } console.log(a); A. 0 B. 4 C. 5 D. 6 E. Infinite loop

E. Infinite loop

Which of the following is FALSE about event-driven programs?

Event-driven programs do not implement algorithms

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 12-bit representation.

F00

Drawing a circle of any size at any point on the screen

Function(s)

Drawing out the letters of a word "HELLO"

Function(s)

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

Functions cannot make calls to other functions within the same program.

Which of the following is NOT part of defining a function?

Giving the parameters a value

Drawing 100 tiny dots in a line

Loop

Drawing a hexagon (six-sided shape)

Loop

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

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

Why are parameters useful when programming?

Parameters allow for more flexible, generalized behaviors in functions.

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 details of how the function is implemented.

Jasmine is writing a shopping app. She has created a variable to keep track of the number of items in the shopping cart. Every time someone clicks the "addItemButton", she would like the variable to increase by 1. Var carTotal= 0; OnEvent ("addItemButton", "click", function (){ //missing code goes here Console.log (carTotal); });

Var cartTotal = cartTotal + 1;

What is the most likely outcome of running the code shown at right?

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.

Using JavaScript how would you output the following to the console? Hello! How are you?

console.log ("Hello! \nHow are you?");

Jose is writing a reply function for a text messaging app. He'd like to swap the sender and receiver so that the value currently in variable From ends up as the value in To and To ends up in From Before: From= James Bond To=Bruce Wayne After: From=Bruce Wayne To=James Bond A. to = from; from = to; B. from = var temp; to = temp; from = to; C. var temp = from; from = to; to = from; D var temp = from; from = to; to = temp; E var temp = to; from = to; to = temp;

d. var temp = from; from = to; to = temp;

Which of the following will call the function drawStar?

drawStar();

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

kilobyte, gigabyte, terabyte

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"?

megadata


Kaugnay na mga set ng pag-aaral

Break-Even Analysis and the Payback Period

View Set

Peds - Chapter 27: Endocrine Disorder

View Set

Chapter 14: Assessing Skin, Hair, and Nails

View Set

Savage Chapter 4: Intro to Community Assessment

View Set

Anatomy & Physiology: Chapter 3 HW1

View Set

Analytical Chemistry Quiz Session 7-8

View Set

CYSA+ Chapter 3 Review Questions

View Set