AP COMP SCI TEST

¡Supera tus tareas y exámenes ahora con Quizwiz!

patttern: Constant Linear Logarithmic Quadratic

1 per x x times per y ylogx scale -google- exponential increase

given the following code segment... what is displayed. a <- 20 b <- a + 30 c <- b * 2 a <- c - a d <- a - b + c DISPLAY (d)

130

Given the following segment of code, what will be displayed? x <-- 3 y <-- 2 REPEAT UNTIL (x > 20) { x <-- x + y y <-- y + 2 } DISPLAY (x) DISPLAY (y) A 23 10 B 33 12 C 23 8 D 33 10

23 10

How many more number values can be represented using 2 decimal digits as compared to 2 binary digits?

25 times as more Using 2 binary digits, the values 0-3 can be represented. This is a total of 4 number values. Using 2 decimal digits, the values 0-99 can be represented. This is a total of 100 values. Thus, 25 times as many values can be represented using 2 decimal digits as compared to 2 binary digits.

how many bits are in the following... hex ascii binary base64

4 8 8 6

*ASK KILGORE* compact means small? If you were to convert the following sentence, "AP CSP is the best class in the entire world" into a different encoding, which would be more compact? a. Hexadecimal b. ASCII c. Base64 d. Binary

A

The procedure displayWords is designed to display two words to the console. It is passed four parameters: For example, calling displayWords("hello", true, "world", false) would display the following: hello world <-- cursor would be here after displaying characters calling displayWords("hello", false, "world", true) would display the following: hello world |<-- cursor would be here after displaying characters What would the following code display to the console? displayWords("Computer", true, "Science ", false) displayWords("is", false, "my", true) displayWords("favorite", false, "subject", true) A Computer Science is my favorite subject B Computer Science is my favorite subject C Computer Science is my favorite subject D Computer Science is my favorite subject

A

Linear Search and Binary Search are two different algorithms that accomplish the same task: searching for a specific value in a list. When comparing algorithms, there are several ways to define efficiency, but in this example let's define efficiency as follows: The algorithm that compares the least number of elements to the search value (in other words, makes the least number of passes through its primary loop) is considered the most efficient. Of the following choices, which one is an example where a linear search is more efficient than a binary search? A Search for the number 10 in the following list: [10, 20, 30, 40, 50, 60, 70, 80, 90] B Search for the number 25 in the following list: [10, 20, 30, 40, 50, 60, 70, 80, 90] C Search for the number 50 in the following list: [10, 20, 30, 40, 50, 60, 70, 80, 90] D Search for the number 90 in the following list: [10, 20, 30, 40, 50, 60, 70, 80, 90] binary search linear search

A search in order break in halfs until a half is found with the item i.e looking for 4 1 2 3 4 1 2 : 3 4 3 : 4 4 2 5 6 8 7 8 9

A company is writing a program to process large data sets. Which of the following is the LEAST important consideration when developing this program? A Binary searches run faster when it comes to large data sets. B Maintaining privacy of large data sets can be challenging. C The effective use of large data sets requires computational tools. D Large data sets include multiple types of data such as text, sound, and images.

A because Binary searches do not run faster when it comes to large data sets as compared to binary searches on smaller data sets. This is a tempting distractor because binary searches become more advantageous and useful as data sets become larger.

Social media continues to evolve and fosters new ways to communicate. Which of the following is associated with the data of a social media post rather than the metadata? A Tags or hashtags. B Topic of posts. C Reaction to posts. D Timestamp of posts.

A tags help filter C tied to data generated from the post D info about the post B This is associated with the data of social media posts. The message of the post itself must be studied to determine the topic of posts.

Restaurants nowadays use software programs to calculate the total bill for their customers. Which of the following could be represented by constants in the program? Select TWO answers. A The sales tax rate. B The cost of each item. C The value of a 10% off coupon. D The number of items ordered.

A+B C depends on actual cost which is veriable

A furniture company has decided to use chat rooms as their primary means of supporting customers. When a customer encounters a problem with their furniture purchase at a local store, the customer is asked to log onto the company's website and join a chat room with a customer support representative. The company has selected chat room software that allows the customer and support representative to communicate via text messages and file transfers, but does not have the capability of viewing each other during the chat session. Of the following statements, which two best explain advantages of using chat rooms for customer support in this case? Select TWO answers. A A customer could take photographs of the issue they are encountering with their furniture and show it to the customer support representative during a chat room conversation. B Chat rooms can be easily accessed and used by all of the company's customers. C Chat rooms allow the customer support representative to determine the emotions of a customer more easily than a telephone conversation or a face-to-face meeting. D Chat rooms allow a customer to have a direct communication with a support person without many of the language and accent issues encountered during verbal conversations.

A+D

Which TWO of the following best describe a TCP/IP packet? Select TWO answers. A A packet contains the address of the destination device. B When sending data between two devices, TCP/IP will certify that each packet is sent along the same path. C To ensure that packets can be reassembled correctly, each packet is received by the receiving device in the same order that it is sent. D A packet is the piece of information that can be routed between devices on the internet.

A+D

Which of the following can be represented using one bit per pixel? Select TWO answers. A Black B Blue C Yellow D White

A+D

*ASK KILGORE* 48. When web developers specify color values for text or backgrounds, they normally use an RGB or Hexadecimal value. RGB values are comprised of three decimal values like (45, 0, 255) where the values correspond to the amounts of red, green and blue that comprise the color. The first two digits in the hexadecimal code correspond to the amount of red in a color, the next two digits, the amount of green and finally, the last two digits represent the amount of blue. What would be the corresponding hexadecimal value for the RGB value (45, 0, 255)? a. #FF002D b. #2D00FF c. #FF002C d. #2C00FF

B

Which is the lowest level of abstraction: ASCII Binary Decimal Hexadecimal

Binary (bits) represent lowest level of abstraction in that all data can be represented by bits

Web filtering and monitoring software is commonly used in schools and homes to block offensive content and provide access to age-appropriate content. The data that is collected by such software for each user on the network include the following: Which of the following is NOT a question that can be answered based on the data for a particular school? name of user websites searched and accessed websites searched blocked time spent on website A What percentage of students are attempting to access blocked websites? B How much time (on average) are users spending on a particular age-appropriate website? C What percentage of the school day are students using educational websites?

C

CIA Triad

Confidentiality - keeping stuff secure Availability - make sure who need to get it get it Integrity - make sure the message is accurate on both ends

how to convert from hex to rgb Hex = FFD700

Get the 2 left digits of the hex color code and convert to decimal value to get the red color level. Get the 2 middle digits of the hex color code and convert to decimal value to get the green color level. Get the 2 right digits of the hex color code and convert to decimal value to get the blue color level. FF0000 FF : D7 : 00 Red: (15 * 16¹) + (15 * 16⁰) = 240 + 16 = 255; Green (13 * 16¹) + (7 * 16⁰) = 208 +7 = 215; Blue (0* 16¹) + (0* 16⁰) = 0 +0 = 0; Rgb(255,215,0);

Consider the following numbers: Hexadecimal 20 Decimal 25 Octal 30 Least to greatest...

Octal 30, Decimal 25, Hexadecimal 20

sequencing

To do things in order, one after another. Executing the statement one at a time, often called linear (top, bottom)

selection bubble insertion swapping

Uses "if...then" to tell computer how to select a step or to tell the sequence that should be executed filter nonexistent nonexistent

parameter

a numerical set that defines a system or sets the conditions of its operation.

A programmer needs to return the last number that is greater than 100 contained in a list named nums. nums will have a majority of elements that are over 100. For example, if nums contains [200, 155, 80, 110, 130, 60], the last number that is greater than 100 in this list is 130. Of the following procedures, which one would typically run the fastest with the least number of iterations through the loop and return the last number greater than 100? Note that once the return statement is read than the program believes it found the correct value A PROCEDURE lastNumOver100 ( nums ) { i <-- 1 REPEAT UNTIL ( i > LENGTH (nums) ) { IF ( nums[i] > 100 ) { RETURN (nums[i]) } i <-- i + 1 } } B PROCEDURE lastNumOver100 ( nums ) { i <-- 1 found <-- 0 REPEAT UNTIL ( i > LENGTH (nums) ) { IF ( nums[i] > 100 ) { found <-- nums[i] } i <-- i + 1 } RETURN (found) } C PROCEDURE lastNumOver100 ( nums ) { i <-- LENGTH (nums) REPEAT UNTIL ( i = 0 ) { IF ( nums[i] > 100 ) { RETURN (nums[i]) } i <-- i - 1 } } D PROCEDURE lastNumOver100 ( nums ) { i <-- LENGTH (nums) found <-- 0 REPEAT UNTIL ( i = 0) { IF ( (found = 0) AND (nums[i] > 100) ) { found <-- nums[i] } i <-- i - 1 } RETURN (found) }

c because it does it in the least amount of loops

moores law doubles every other year for _______ single for every

computing speed chip

how to convert from any base to hex?

convert to decimal first then convert to hex

Bubble Selection Insertion Replacing

filter Uses "if...then" to tell computer how to select a step or to tell the sequence that should be executed nonexistent non existent

which has more abstraction: low or high?

high

https://admissions.myCollege.edu/student/signin.pdf transfer protocol domain name top level domain or domain extension

https myCollege.edu edu

binary is a ___ level language

low

ddos attack comes from how many devices...

many

heuristic approach

most appropriate when there is not enough time to find an exact solution and an estimated solution is ok

*ASK KILGORE* Program implementation *Debugging* *Pseudocode* Program detection

nonexistent To identify and remove errors from a computer program An informal method or writing algorithmic instructions that do not necessarily follow grammatical rules and syntax of a particular language. nonexistent

the condition of logic gates can either be *_______* or *_______*. whether its true or false is determined by the _______. inputs are represented with _______ with ______, all must be false for it to be false otherwise true with _______, all must be true for it to be true otherwise false

or and inputs arrows or and

Moore's law

processing speeds tend to double every two years

*ASK KILGORE* 49. Sometimes we care about the order of a list, and need to reorder the items according to a condition (alphabetical, numerical, etc). An algorithm finds the minimum value in the list and swaps it with the value in the first position, then repeats these steps for the remainder of the list, swapping with the second position, then the third position and so forth. What type of sorting is this? a. selection b. bubble c. insertion d. swapping

selection

*ASK KILGORE* 55. Which sorting technique, in general, is most efficient? a. Bubble b. Selection c. Insertion d. Replacing

selection

malware

software that is intended to damage or disable computers and computer systems

Source Code

source code is often transformed by an assembler or compiler into binary machine code

Algorithms

specific set of instructions

Creative Commons

that enable the free distribution of an otherwise copyrighted work

Pubic Key encyryption

the standard encryption technique used on the Internet today when transactions need to be secure sender uses recipient's public key to encrypt the message and the recipient uses a private key to decrypt the message

Redundancy

the state of being not or no longer needed or useful

decimal to any base

write out the bases needed from left to right, calculate how much each base goes into the number an subtract it do this until 0 is left, number on top is answer

How to convert from dec to hex Example: 513

write out the bases needed from left to right, calculate how much each base goes into the number an subtract it do this until 0 is left, number on top is answer 513 0 16^3 - 16^2 - 16^1 - 16^0 513 0 2 16^3 - 16^2 - 16^1 - 16^0 2 * 256 = 512 513-512 = 1 1 0 2 0 16^3 - 16^2 - 16^1 - 16^0 1 0 2 0 1 16^3 - 16^2 - 16^1 - 16^0 1 * 1 = 1 1 - 1 = 0; answer is *0201*

dec to binary decimal number: 57

write out the bases needed from left to right, calculate how much each base goes into the number an subtract it do this until 0 is left, number on top is answer 57 1 2⁵ - 2⁴ - 2³ - 2² - 2¹ - 2⁰ 1*32 = 32 57-32=25 25 1 1 2⁵ - 2⁴ - 2³ - 2² - 2¹ - 2⁰ 1*16 = 16 25-16=9 9 1 1 1 2⁵ - 2⁴ - 2³ - 2² - 2¹ - 2⁰ 1*8 = 8 9 - 8 = 1 1 1 1 1 0 2⁵ - 2⁴ - 2³ - 2² - 2¹ - 2⁰ 1 1 1 1 0 0 1 2⁵ - 2⁴ - 2³ - 2² - 2¹ - 2⁰ 1 * 1 = 1 1 - 1 = 0; The answer is *111001*

binary to dec Binary number: 1101

write out the bases needed write the number over the bases multiply each number add the result 1 1 0 1 2^3 - 2^2 - 2^1 - 2^0 1*8 + 1*4 + 0*2 + 1*1 8 + 4 + 0 + 1 = *13*

A programmer would like to check whether a temperature is in the 80's (80-89), but not exactly 85. If variable temp is an integer number which represents the temperature, which of the following procedures will implement this logic and return true if this is the case or false otherwise? good or bad PROCEDURE checkTemp ( temp ) { IF ( NOT (temp = 85) AND (temp > 80) AND (temp < 89) ) { RETURN (true) } ELSE { RETURN (false) } }

bad 89 and 80 are not included

The following procedure controls the movement of a turtle in a grid. This procedure has two integer parameters a and b. PROCEDURE controlTurtle ( a, b ) { REPEAT a TIMES { MOVE_FORWARD () REPEAT b TIMES { ROTATE_RIGHT () } } } If the initial position of the turtle is in the center square facing north as shown below, where would the turtle end up if this procedure were called as follows: controlTurtle (2, 3)? [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ^][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] -- [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][->][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ d][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ d][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][->][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ]

c

How to convert from any base to decimal: Example: Base 16 Hexadecimal Number: 20

write out the bases needed write the number over the bases multiply each number add the result 2 0 16^1 - 16^0 2*16 + 0^1 32 + 0 = *32*

capital letters range from 65-90 lowercase letters range from 97-122 decimal 65 = A KNOWING THIS, WHY ARE THESE STATEMENTS TRUE? hexadecimal letter 65 corresponds with a lower case letter an uppercase ASCII character can be changed to its corresponding lowercase character by changing one bit in the binary value

65 in decimal is 101 which falls between 97 and 122 if you have a binary bit that reads: 01*1*00001 which is 97 and is in the lowercase range... and you change the string to 01*0*00001... it now reads 65 which is in the lowercase range

Of the following, which best explains a major reason why redundancy is important on the Internet? A Redundancy allows the network to respond to issues that occur, so that information can more reliably flow between computers over the Internet. B Redundancy discourages computer hackers from attacking and taking over websites. C Redundancy allows offline computers that are not on the Internet to have access to other computers on the Internet. D Redundancy on the Internet is accomplished primarily by implementing shadow computers whose main purpose is to back up the primary computers in case they go down

A

The diagram below shows a circuit composed of two logic gates labeled OR and AND. Each gate produces a single output based on two inputs. Which of the following describe conditions where output will evaluate to true? Select TWO answers. X Y | | AND Z | | | OR A X is true, Y is false, Z is false B X is false, Y is false, Z is true C X is true, Y is true D Y is true, Z is false

B+C

The following procedure has two integer parameters: x and y. PROCEDURE mathWithNums (x, y) { result <-- (( x * y ) / (4 * x)) DISPLAY (result) } A negative number is defined as a number less than zero, and a positive number is defined as a number greater than zero. Of the following choices, when would this procedure always display a positive number? A When x is a negative number and y is a positive number B When x is a positive number and y is a negative number C When both x and y are negative numbers D When either x or y is zero

A

2 mod 2

0

2 mod 2 2 mod 1 3 mod 2

0 0 1

The following procedure returns true if a bowler on the high school bowling team qualifies for the all-conference team, or false if the bowler did not make the team. These three parameters are passed to the procedure: Here is the procedure: PROCEDURE isAllConference (confTournPlace, confBowlingAverage, allConfVotes) { IF ( ((confTournPlace < 11) OR (confBowlingAverage > 180)) AND (allConfVotes > 4) ) { RETURN (true) } ELSE { RETURN (false) } } Which of the following calls to isAllConference will indicate that the bowler qualifies for the all-conference team? A isAllConference ( 12, 185, 5 ) B isAllConference ( 5, 180, 1 ) C isAllConference ( 14, 170, 6 ) D isAllConference ( 7, 191, 4 )

A

A cupcake company has decided to sell their products online. They have hired a team of programmers to design and implement their new website. The company wants to make sure that all transactions and customer data are secure when their customers are interacting with the website. After doing their own minimal research, they have decided to use public key encryption for customer financial transactions. Is public key encryption considered a secure approach for the company's customer transactions? Select the most accurate answer. State why wrong for the incorrect choices A Yes, public key encryption is a good form of encryption in this case. The sender uses a recipient's public key to encrypt the message and the recipient uses a private key to decrypt the message. B Yes, public key encryption is a good form of encryption in this case. The data is sent in binary form which makes it very difficult to decrypt. C No, public key encryption is not a good form of encryption in this case. The sender uses a recipient's public key to encrypt the message and that same public key is used to decrypt the message. D No, public key encryption is not a good form of encryption in this case. Since the encryption key is public, it is easy to reverse-engineer the encryption to uncover the original message.

A B everything is sent in binary, so this is not a good reason for using public key approach C this referees to symmetric key encryption not public D it is not easy reverse engineer the encryption because the private key is known only by the recipient

Which of the following are most likely examples of DDoS (Distributed Denial of Service) attacks? Select TWO answers. A A store's website is suddenly overwhelmed with identical item inquiries sent simultaneously from multiple IP addresses. B A teacher opens an email from the System Administration Department which threatens a denial of internet access unless she enters her login credentials after clicking on the supplied link. C A hacker writes a program to continually send text messages from his cell phone to his rival's cell phone, making it temporarily unusable. D The software on a certain brand of baby monitor is hacked so that at midnight last night all the monitors sent bogus data to the parent company's website server.

A+D

A program is supposed to add the elements at even positions in list and display the result. For example, if list <-- [10, 21, 33, 40, 52], then it should display 61 (which is 21 + 40 at positions 2 and 4). Of the following code segments, which two will successfully accomplish this task? Select TWO answers. A i <-- 1 total <-- 0 REPEAT ( LENGTH (list) ) TIMES { IF ( (i MOD 2) = 0 ) { total <-- total + list[i] } i <-- i + 1 } DISPLAY (total) B total <-- 0 REPEAT ( LENGTH (list) ) TIMES { i <-- 1 IF ( (i MOD 2) = 0 ) { total <-- total + list[i] } i <-- i + 1 } DISPLAY (total) C i <-- 2 total <-- 0 REPEAT UNTIL ( i > LENGTH (list) ) { total <-- total + list[i] i <-- i + 2 } DISPLAY (total) D total <-- 0 FOR EACH num IN list { IF ( (num MOD 2) = 0 ) { total <-- total + num } } DISPLAY (total)

A+c

A list named cities contains the names of all the cities in a state. A list named populations contains the populations of the corresponding cities in the cities list. For example, if cities contains ["Atlanta", "Macon", "Augusta"] and populations contains [500000, 95000, 200000], this means that Atlanta has a population of 500,000, Macon has a population of 95,000, and Augusta has a population of 200,000. The following procedure attempts to add city names to a new list named largeCities. This list should only contain the names of cities with a population over 100,000. LINE 1: PROCEDURE createLargeCitiesList () LINE 2: { LINE 3: i <-- 1 LINE 4: FOR EACH pop IN populations LINE 5: { LINE 6: IF (pop > 100000) LINE 7: { LINE 8: APPEND ( largeCities, i ) LINE 9: } LINE 10: } LINE 11: } However, this code is not working properly. Of the following, how could it be corrected so that it works as designed? A Replace LINE 8 with: APPEND ( largeCities, cities[i] ) Insert between LINE 8 and LINE 9: i <-- i + 1 B Replace LINE 8 with: APPEND ( largeCities, cities[i] ) Insert between LINE 9 and LINE 10: i <-- i + 1 C Replace LINE 8 with: APPEND ( cities, largeCities[i] ) Insert between LINE 8 and LINE 9: i <-- i + 1 D Replace LINE 8 with: APPEND ( cities, largeCities[i] ) Insert between LINE 9 and LINE 10: i <-- i + 1

B

Digital images are often represented by pixels, where each individual pixel has red, green, and blue color components. A student edits and overwrites the original image. Which of the following is characteristic of a lossy compression of the image? A Larger file size than that of the original image. B Permanent loss of data. C Application of heuristics. D More time to upload and transmit

B

Health and medical organizations often use simulations to model the spread of infectious diseases in a population. Which of the following represents the primary benefit and reason for using a simulation in this case? A The simulation simplifies the spread of disease and omits unnecessary features. B The simulation mimics the actual spread of disease without the danger of testing it out in the real world. C The simulation will allow for rapid and extensive testing of models. D The results of the simulation may generate new knowledge and new hypotheses.

B

In the year 2018, a computer scientist used Moore's Law to predict the amount of digital data created and consumed in the U.S. in 2020 would be approximately 30,000 exabytes. Based on this prediction, which of the following could be the approximate amount of data created and consumed in the U.S. in the year 2018? A 7,500 exabytes. B 15,000 exabytes. C 30,000 exabytes. D 60,000 exabytes

B

Which of the following algorithms will NOT result in an infinite loop? A num <-- 1 REPEAT UNTIL ( num > 10 ) { num <-- num - 1 } B i <-- 1 list <-- [50, 60] REPEAT UNTIL ( i > LENGTH (list) ) { INSERT (list, i, list[i] + 1) i <-- i + 2 } C i <-- 1 list <-- [10, 20] REPEAT UNTIL ( i > LENGTH (list) ) { APPEND (list, list[i] + 1) i <-- i + 1 } D num1 <-- 1 num2 <-- 1 REPEAT UNTIL ( num1 > num2 ) { num1 <-- num1 + 1 num2 <-- num2 + 2 }

B

Which of the following best describes a valid function of the Domain Name System (DNS)? A A text message is split into pieces and routed across the internet, where DNS reassembles the pieces into the source message. B A purchasing agent types "bigbox.com" into their web browser, and a DNS server translates it into the IP address 303.27.19.102. C A customer enters his credit card information into a secured website and DNS ensures that this information is transmitted securely across the internet. D A company has thought of a catchy website name, and contacts DNS to purchase the rights to its domain.

B

You are given the following segment of code. Parameters a, b, and c are all different integer values (none are the same value). LINE 1: PROCEDURE numDisplay ( a, b, c ) LINE 2: { LINE 3: IF (a > b) LINE 4: { LINE 5: IF (b > c) LINE 6: { LINE 7: DISPLAY (b) LINE 8: } LINE 9: ELSE LINE 10: { LINE 11: IF (a > c) LINE 12: { LINE 13: DISPLAY (c) LINE 14: } LINE 15: ELSE LINE 16: { LINE 17: DISPLAY (a) LINE 18: } LINE 19: } LINE 20: } LINE 21: ELSE LINE 22: { LINE 23: IF (b > c) LINE 24: { LINE 25: IF (c > a) LINE 26: { LINE 27: DISPLAY (c) LINE 28: } LINE 29: ELSE LINE 30: { LINE 31: DISPLAY (a) LINE 32: } LINE 33: } LINE 34: ELSE LINE 35: { LINE 36: DISPLAY (b) LINE 37: } LINE 38: } LINE 40: } Of the following, which best describes the main purpose of the procedure numDisplay? A The procedure will compare the three numbers represented by parameters a, b, and c and display the number that is numerically the least. B The procedure will compare the three numbers represented by parameters a, b, and c and display the number that is numerically in between the other two numbers. C The procedure will compare the three numbers represented by parameters a, b, and c and display the number that is numerically the greatest. D The procedure will randomly display one of the numbers represented by parameters a, b, and c.

B

A programmer is developing a program to play a card game which uses a standard deck of 52 playing cards. Each deck contains four suits (diamonds, hearts, spades, and clubs) with 13 cards (1-9, jack, queen, king, and ace) per suit. Which of the following code segments will simulate drawing either a king or an ace from a full deck? there are four aces and four kings in a standard deck of 52 cards A IF ( RANDOM (1, 52) < 8 ) { DISPLAY ("king or ace drawn") } ELSE { DISPLAY ("NOT a king or an ace") } B IF ( RANDOM (1, 13) < 3 ) { DISPLAY ("king or ace drawn") } ELSE { DISPLAY ("NOT a king or an ace") } C IF ( RANDOM (1, 4) = 1 ) { DISPLAY ("king or ace drawn") } ELSE { DISPLAY ("NOT a king or an ace") } D IF ( RANDOM (1, 13) = 2 ) { DISPLAY ("king or ace drawn") } ELSE { DISPLAY ("NOT a king or an ace") }

B chance is 8/52 or 2/13 and b simulates this chance value 1 or 2 chance of drawing king or ace

A phone company is studying a large data set that contains information about customers' phone plans for a given month. total number of callinb minutes used amount of data used number of people on a plan type of phone of each user Which of the following questions can NOT be answered by analyzing only information in the data set? A Do plans that use a high number of calling minutes also use a high amount of data? B Which phone on the plan uses the most data? C What is the average number of people of a plan across the company? D What percentage of plans have at least one non-smartphone on the plan?

B because the total amount of data between all the phones is calculated not the individual amount

Fingerprint recognition is a technology that identifies and confirms the identity of individuals, and it is used widely in forensic science. Which advances in computing have most likely contributed to the development of fingerprint recognition software? Select TWO answers. A Metadata for large data sets. B Accurate and reliable databases. C Development of softwares to recognize patterns. D Enhanced creativity in medicine and science.

B+C

The following diagram depicts a computer network configuration. Circles A-G represent computers on the network. Two computers are directly connected if there is a line between them. Which of the following statements are true concerning this computer network? Select TWO answers. ↙ E ↘ D↘↙ F ^↙B↘^ C↘ | ↙G A A There are exactly two paths that will allow computer F to communicate with computer A. B In order for computer B to communicate with computer E, it must eventually connect through either computer D or computer F. C There are more than three paths available to allow computer C to communicate with computer G. D If computer B is offline and therefore unavailable, at least one of the other computers (A, C, D, E, F, or G) would be inaccessible by the remaining computers (A, C, D, E, F, or G).

B+C

Golf scores can be recorded as the number of strokes above or below par for the course. For example, if par for the course is 71 and the golfer shoots an 80, then 9 would indicate 9 strokes above par. If the golfer shoots a 69, then -2 indicates that he/she is 2 under par, and if the golfer shoots a 71, then a 0 would indicate a score of even par. A list named scores is used to record the number of strokes under/over par during multiple rounds of golf. Each element represents a separate round of golf. *A programmer writes the following code to display the total number of strokes under/over par for all of the rounds of golf recorded in scores:* numRounds <-- LENGTH ( scores ) - 1 underOver <-- 0 i <-- 1 REPEAT numRounds TIMES { underOver <-- underOver + scores[i] i <-- i + 1 } DISPLAY (underOver) Which of the following test cases would prove that this code segment is not always displaying the correct result? Select TWO answers. A scores <-- [3, 4, 0, 1, -1, 0] B scores <-- [2, -2, 0, 3, 3] C scores <-- [0, 2, 1] D scores <-- [-2, -3, 4, 0]

B+C A+D incorrect because last element is not being added although it does not matter because last element = 0

Of the following, which two are the best reasons for using comments in your code? Select TWO answers. A Comments are essential for optimizing the execution speed of your program. B Comments are useful when testing, to temporarily have the compiler or interpreter ignore lines of code. C Comments are typically used to rate the usefulness of a procedure or block of code. D Comments are useful for explaining the purpose of a procedure.

B+D

Which of the following are true statements about Machine Learning technology? Select TWO answers. A One of the benefits of machine learning applications is that they require much less data than traditional computer applications. B If creating an application to find patterns in complex data, using machine learning technology would be a good alternative. C Implementing machine learning technology is a good choice when the timeline for developing the application is short or the project budget is tight. D Machine learning is used in software developed in a variety of different sectors, including finance and ecommerce.

B+D

Chris receives an email which is supposedly from his Internet Service Provider (ISP). Since Chris is not expecting the email, he is wondering if it is a phishing attack. Which of the following would be the biggest indication that the email was possibly a phishing attempt? Why not this? The email contains the realistic-looking company logo and address information for the ISP.

Both a normal email and a phishing email could contain the official logo of the company and valid company address information. This makes a phishing email look more authentic. The question asks if the email is obvious that it is phishing which it is not in this case.

A program is expressed in a programming language. Which of the following is NOT true of the program? A The program could be expressed in another programming language. B The choice of programming language was probably made to suit a particular domain. C The program could be expressed in a higher-level language but data can no longer be represented in binary. D The program could be expressed in a lower-level language but some of the abstracted features may be lost

C

A restaurant collects information about items ordered by customers on a daily basis. Each week, the following information is reviewed in order to determine the total number of individual items sold. The data gathered for one day is shown in the table below. Day and Date Name of the Item Number of times that the item was ordered Thu 02/01/2018 Item 1 56 Thu 02/01/2018 Item 2 72 Thu 02/01/2018 Item 3 45 Thu 02/01/2018 Item 4 41 Thu 02/01/2018 Combo Item 1 19 Thu 02/01/2018 Combo Item 2 22 What additional step should the restaurant take in order to determine the total number of individual items sold? A Add in the price of the items. B Consider the placement of items on the menu. C Factor in the number of individual items in combo items. D Calculate the sum of all the values in the last column.

C

Digital images are often represented by pixels. A student is creating an image using a pixel art tool where the number of bits per pixel can be adjusted. She starts with 3 bits per pixel and then changes it to 2 bits per pixel. How does this change affect her image? A The colors from the original image will now be brighter. B The colors from the original image will now be darker. C The image will be in black and white. D The image will be in grayscale.

D because three bits need to be available for color C will happen if changed to one bit as one bit represents two outcomes

A sizable group of students in a given county have volunteered for a study. All of their browsing activity is stored on a cloud computer. Each time a student visits a website using their device, the following information is stored on the cloud: Additionally, the cloud computer is able to link the randomly generated device number to a specific student in their database, where it also stores the gender, age, and zip code of each student. The statistician who designed the study is hoping to gather some valuable information in order to uncover trends. Which of the following facts would the statistician be least likely to discover using this information? A The average number of distinct domains visited by students in each zip code on a certain day B The domain that was most visited by students each month C The most common type of device students used to visit websites between 6:00-8:00am D The hour within a day that students visit websites most frequently

C

According to the following flowchart, when will the message "Qualifies" be displayed? Start ↓ width < 10 ↓ true depth < 20 ↓ false height < 5 ↓ true A IF ( (width < 10) OR (depth < 20) OR (height < 5) ) B IF ( (width < 10) AND (depth < 20) AND (height < 5) ) C IF ( (width < 10) OR (depth >= 20) OR (height < 5) ) D IF ( (width < 10) AND (depth >= 20) AND (height < 5) )

C

Suppose that you are provided with the following URL (Uniform Resource Locator): https://admissions.myCollege.edu/student/signin.pdf A admissions is the subdomain, myCollege is the domain name, and /student/signin.pdf is the domain extension. B edu is the transfer protocol, myCollege is the domain name, and /student/signin.pdf is the subdomain. C https is the transfer protocol, myCollege.edu is the domain name, and edu is the top level domain. D https is the transfer protocol, myCollege.edu is the domain name, and /student/signin.pdf is the top level domain.

C

The following choices depict a specific computer network configuration. Computers A-G are listed in each diagram. A line between two computers means that there is a direct connection between the computers. An "X" on the line means that the connection is broken and the two computers cannot communicate directly. A company has computers A-G. At this point in time: Which of the following computer network diagrams shows this relationship? A with G but not E F dir and indir with G D with E but not B Connection where every computer may communicate with one another. ↙ E ↘ D↘↙ F ^↙B↘^ C↘ | ↙G A A ↙ E X D↘↙ F X↙B↘X C↘X↙G A B ↙ E X DX↙ F X↙B↘X C↘ |↙G A C ↙ E X DX↙ F X↙B↘^ C↘ | ↙G A D ↙ E X DX↙ F ^↙B↘^ C↘X↙G A

C

Which of the following scenarios would typically pose the least amount of risk when dealing with digital information? A Karen stops at a small convenience store on her way to the beach and gives the cashier her credit card for five minutes as she pumps gas at the pump. B Andrew makes a repeat purchase from a store on the Internet whose website URL begins with http://. C Stuart performs a money transfer from his state bank using an app supplied by the bank. D Jack texts his social security number to his doctor in order to set up a medical history account.

C

Which of the following statements is true about using a heuristic approach for solving a problem? A If you had a wager with your sibling on who is the tallest person in your family, it would be appropriate to use a heuristic approach. B Using a heuristic approach is best if you have all the necessary information and knowledge to solve the problem. C It would be appropriate to use a heuristic approach if time is running out and an approximate solution is acceptable. D A heuristic approach would be appropriate if you needed to solve a mathematical puzzle that provides a number that unlocks the door to get you out of an escape room.

C

A programmer creates the following procedure which is passed three positive integer parameters x, y, and z: PROCEDURE calcNum (x, y, z) { num <-- x REPEAT z TIMES { num <-- num + y } num <-- num * 3 DISPLAY (num) } Which of the following procedures would always return the same result as this procedure? A PROCEDURE calcNum (x, y, z) { DISPLAY ( (x + y + z) * 3 ) } B PROCEDURE calcNum (x, y, z) { DISPLAY ( ((x + y) * z) * 3 ) } C PROCEDURE calcNum (x, y, z) { DISPLAY ( (x + (y * z)) * 3 ) } D PROCEDURE calcNum (x, y, z) { DISPLAY ( x + y * z * 3 ) }

C The initial algorithm initializes variable num to x. Then it loops z times and adds y to num that many times, which means that it is adding y * z to num. Finally, it multiplies this result by 3.

A list named dictionary is a list of each word from an official dictionary. The following procedures can be used to analyze the words in dictionary: A programmer would like to know the percentage of words in the dictionary that contain the letter "z" but do not start with the letter "z". Which of the following code segments would accomplish this task? A DISPLAY ( wordsContainCharCount ( "z" ) - wordsWithStartCharCount ( "z" ) ) B DISPLAY ( LENGTH (dictionary) / (wordsContainCharCount ( "z" ) - wordsWithStartCharCount ( "z" )) ) C DISPLAY ( (wordsContainCharCount ( "z" ) - wordsWithStartCharCount ( "z" )) / LENGTH (dictionary) ) D DISPLAY ( LENGTH (dictionary) - wordsContainCharCount ( "z" ) - wordsWithStartCharCount ( "z" ) )

C because it's looking for percentage not total number of words including yet not starting off with z

A city in the United States has decided to computerize their entire local voting process so that their citizens no longer have to travel to a polling place to cast their votes. Voters can simply log onto an app and vote during a certain time period. The city plans to do away with the various polling places, all paper-related processes, and the associated staff in order to save money. Of the following, which category of voters would typically be most disadvantaged with this approach? Select TWO answers. A College graduates. B Younger voters. C Poor people. D Elderly voters.

C+D

Which of the following is TRUE about low-level and high-level programming languages? Select TWO answers. A In general, the code produced using a high-level programming language is more difficult for a human to understand than the code produced using a low-level programming language. B A machine language such as assembly language is an example of a high-level programming language. C A high-level programming language is more likely to be used to create an app that needs to run on multiple operating systems and devices. D A high-level programming language has a higher level of abstraction to the instruction set of a computer's processor than a low-level language.

C+D

Images can have large amounts of metadata associated with them. Which of the following represent metadata for an image? Select TWO answers. A Number of items in the image. B Names of people in the image. C Color components. D Image size.

C+D by metadata they mean data that cannot be simply answered by studying the image itself rather the data about the image: (color, size)

A cybersecurity firm has developed a new suite of products and is marketing its products to a local technology company. As part of the marketing campaign, the cybersecurity firm runs simulations of cyber attacks on the technology company. Which of the following are reasons to use simulations in this context? I. The simulations can anticipate all possible cipher attack scenarios that the company may face II. The simulations mimic real world cipher attacks scenarios without the danger of putting the company's actually privacy and security at risk III. The simulations can help identify vulnerabilities in the company's security A I and II only. B I and III only. C II and III only. D I, II, and III.

CI is not true and never is with simulations as there are simplifications of actual attacks

Chris receives an email which is supposedly from his Internet Service Provider (ISP). Since Chris is not expecting the email, he is wondering if it is a phishing attack. Which of the following would be the biggest indication that the email was possibly a phishing attempt? Why this? The body of the email states that the embedded link in the email labeled "Enter phone number" is a shortcut to the company's account information screen.

Chris is justified for being nervous about the email. Warning bells should go off when you *see a link within an email that asks you to enter personal information* (in this case a telephone number). The link could take Chris to a fake website with the intent of *retrieving his personal information*. This is the biggest clue that the email might be a phishing attack, and Chris should avoid clicking on this link.

A procedure is defined as follows: PROCEDURE numMod ( x, y ) { IF ( ((x MOD 2) = 0) AND ((x MOD 3) = 0) AND ((y MOD 2) = 1) ) { RETURN (true) } ELSE { RETURN (false) } } Which of the following calls to numMod would return true? A numMod (4, 5) B numMod (12, 4) C numMod (8, 9) D numMod (6, 3)

D

Checking the weather outside is as simple as opening up an application or searching for it on the Internet. However, weather forecasting can involve complicated simulations. Which of the following is NOT true about weather forecasting models? A The time required to develop simulations is impacted by the number of variables and level of quality. B Several different forecasting simulations may be run and refined multiple times a day. C As complicated as the models may be, they are still simplified representations of weather. D Multiple levels of abstraction and the use of heuristics help predict the exact weather for up to 7 days.

D

FOR EACH item IN listA { IF ( (item MOD 2) = 0 ) { INSERT (listB, 1, item) } ELSE { APPEND (listB, item) } } If the lists are initialized as follows, what will listB contain after the segment of code executes? listA <-- [3, 10, 4, 5, 6] listB <-- [70, 20, 80] A [10, 4, 6, 70, 20, 80, 3, 5] B [70, 6, 4, 10, 20, 80, 3, 5] C [5, 3, 70, 20, 80, 10, 4, 6] D [6, 4, 10, 70, 20, 80, 3, 5]

D

Kim has recently purchased a new computer which includes a free subscription to an Internet Service Provider, free email software, a web browser, and a productivity software package. A week later, Kim receives a phone call. The caller explains that the new computer requires special data transmission software to send and receive emails using the free email software package. The data transmission software will allow messages to be sent across the Internet and it is available for a one-time price of $49.99. Kim is confused but wants to use the email software. Of the following, which is the best action for Kim to take? A Kim should purchase the data transmission software at the specified rate in order to send/receive messages. B Kim should purchase the data transmission software only after confirming with the caller that it is compatible with both the email software and the web browser. C Kim should not purchase the data transmission software, since there are certainly less expensive data transmission packages available for purchase in the marketplace. D Kim should not purchase the software, since data transmission is already a built-in component of the Internet using standard protocols

D

Restaurants nowadays use software programs to calculate the total bill for their customers. Given the subtotal, the function calculate is supposed to calculate the total bill, which includes the sales tax. The program is run with a sales tax rate of 5% and a table of the expectations and the actual outputs are given below. Expected Run Match? (Y/N) calculate(20) → 21 1 N calculate(40) → 42 2 N calculate(50) → 52.5 2.5 N calculate(100) → 105 5 N Which of the following statements best describes the error in the program? A The sales tax rate was not set to 5%. B The program did not compute the sales tax correctly. C The program needs a better-named function called calculateTotal. D The program calculated the sales tax correctly but didn't add it to the subtotal.

D

Sally owns a tennis racquet that she has outgrown and would like to sell. She is debating on whether to advertise it on her social media account, where she has about fifty followers, or on one of the national online marketplace websites that specializes in selling used merchandise. Of the following, which is the least likely to be true? A If Sally wants to sell only to friends and acquaintances, she should only use social media to advertise it. B If Sally wants to get the best price for the racquet, she should advertise on both social media and post it on the marketplace website. C If Sally wants to advertise to anyone currently looking to purchase a racquet, she should focus selling it on the marketplace website. D If Sally has set a non-negotiable price for the racquet, she should only use social media to advertise it

D

The following diagram depicts a circuit composed of two logic gates. The output of the overall circuit is false. g1: (true) (a) -> (and) g2: (false) (g1) -> (or) Given this circuit diagram and its output of false, which of the following choices is correct? A There is no possible value of input A that will cause the circuit to have the output false. B Input A can be either true or false. C Input A must be true. D Input A must be false.

D

Time and location represent two of the many types of data that are phones transmit and receive. Even though federal regulations require phones to be turned off or in a non-transmitting mode during flights, conclusions about trips can still be drawn from the cell phone data. Which of the following can NOT be determined based on time and location data from a cell phone? A Length of trips. B Length of flights. C Number of trips. D Cost of plane tickets.

D

[ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][^ ][ ][ ][ ] [ ][ ][ ][ ][ ] which will cause the turtle to visit the lowest amount of unique cells a) REPEAT 2 TIMES { MOVE_FORWARD () ROTATE_RIGHT () MOVE_FOWARD() } b) MOVE_FORWARD () REPEAT 2 TIMES { MOVE_FORWARD () MOVE_FORWARD () ROTATE_RIGHT () } c) REPEAT 3 TIMES { MOVE_FORWARD () ROTATE_RIGHT () } ROTATE_LEFT () MOVE_FORWARD () d) MOVE_FORWARD () REPEAT 2 TIMES { MOVE_FORWARD () MOVE_FORWARD () REPEAT 2 TIMES { ROTATE_RIGHT () } }

D

listA and listB are separate lists, each which contain exactly three integer values. A programmer is asked to write a program that results in listA containing the numbers from listB in reverse order, and listB containing the numbers from listA in reverse order. For example, if listA and listB are initialized as follows, here is what they would contain after the program executes: Initial values: listA; Initial values: listB; Ending values: listA; Ending values: listB [10, 30, 20]; [60, 50, 70]; [70, 50, 60]; [20, 30, 10] which of the following code segments will preform this logic correctly? A listA[1] <-- listB[3] listA[2] <-- listB[2] listA[3] <-- listB[1] listB[1] <-- listA[3] listB[2] <-- listA[2] listB[3] <-- listA[1] B listC <-- [0, 0, 0] listC[1] <-- listA[1] listC[2] <-- listA[2] listC[3] <-- listA[3] listB[1] <-- listA[3] listB[2] <-- listA[2] listB[3] <-- listA[1] listA[1] <-- listC[3] listA[2] <-- listC[2] listA[3] <-- listC[1] C listC <-- [0, 0, 0] listC[1] <-- listA[3] listC[2] <-- listA[2] listC[3] <-- listA[1] listA[1] <-- listB[3] listA[2] <-- listB[2] listA[3] <-- listB[1] listB[1] <-- listC[3] listB[2] <-- listC[2] listB[3] <-- listC[1] D listC <-- [0, 0, 0] listC[1] <-- listA[1] listC[2] <-- listA[2] listC[3] <-- listA[3] listA[1] <-- listB[3] listA[2] <-- listB[2] listA[3] <-- listB[1] listB[1] <-- listC[3] listB[2] <-- listC[2] listB[3] <-- listC[1]

D

A programmer is programming an algorithm to return the greatest possible number less than a given number n. Since a number can have an infinite number of decimal places, this problem is unsolvable. Of the following, which would be the most reasonable way for the programmer to solve the problem without causing the program to run an excessive amount of time? Assume that the arithmetic can produce any number of decimal places. Give reasoning for all A Program the algorithm to loop 100 times and each time randomly select a number between n - 1 (inclusive) and n (exclusive), then return the largest of these random numbers. B Program the algorithm as follows: Provide a parameter for the number of decimal places to round the number to. Return the greatest number less than n rounded to this many decimal places. C Program the algorithm as follows: Assign n to x. Divide x by 2 and replace x with that number. Continue to do this until x is the greatest number less than n. D Program the algorithm as follows: Assign n - 1 to x. Loop and keep adding 0.1 to x until x is greater than n. Then return x - 0.1.

D This approach will produce a reasonable solution that rounds the result to a desired number of decimal places. The programmer should be able to program this solution by simply subtracting a decimal number from the original number n. For example, if n is 20.2 and the number of decimal places is 5, then 20.2 - .00001 would result in the number 20.19999 A result is unreliable B can be infinite C just returns N

Which of the following is a valid statement about IETF? A IETF is a standard used to design system interfaces on the Internet. B IETF stands for Internet Engineering Targeting Function. C The purpose of the IETF is to develop standards for compiling program code on the Internet. D The IETF is composed of volunteers whose mission is to create and promote Internet standards. What does it stand for?

D Internet Engineering Task Force

Which of the following code segments will NOT always display the largest of two numbers, num1 and num2? The following table shows the desired result for three different examples: num1 num2 Display 25 25 25 10 20 20 40 30 40 A IF (num2 > num1) { DISPLAY (num2) } ELSE { DISPLAY (num1) } B IF (num2 < num1) { DISPLAY (num1) } ELSE { DISPLAY (num2) } C IF (num2 > num1) { DISPLAY (num2) } ELSE { IF (num1 = num2) { DISPLAY (num2) } ELSE { DISPLAY (num1) } } D IF (num2 > num1) { DISPLAY (num2) } ELSE { IF (num2 < num1) { DISPLAY (num1) } }

D doesn't handle if numbers are equal

A programmer creates an algorithm to display the number of digits in an integer number. Now the programmer would like to perform this algorithm for a list of integer numbers. What type of building block is necessary when modifying this algorithm to process a list of numbers? A Selection B Iteration C Sequencing D Storage

Iteration not c - There is nothing stated in the prompt that alludes to adding new commands that must be executed in order

Some problems have no solution, so they cannot be solved with any algorithm. Given the following problems, which is an example of a problem which has no solution? Give reasoning? A On average, a wind turbine makes ten revolutions per minute, and each revolution produces x units of electricity. During a typical day how many units of electricity will be produced on average from a wind farm of 100 wind turbines? B A number of tests were given this semester in an AP Computer Science class. Alice made an "A" on half of these tests and a "B" on two of the tests. Tom made an "A" on five of these tests and a "B" on 20% of the tests. If Alice and Tom took all of these tests and made the same number of "A"s and "B"s, how many tests were given this semester? C Assume that two trains are currently 100 miles apart, signified by points A and B. If an eastbound train is travelling 50 miles per hour on one set of tracks and a westbound train is travelling 60 miles per hour on a parallel set of tracks, how many miles did the eastbound train travel from point A as both trains reached the same point on the tracks? D Farmer Joe has a grove of x orange trees, where x is greater than zero. Farmer Jill also has a separate grove of exactly the same number of orange trees. A major frost hit the area and destroyed 20% of (x+10) trees in Farmer Joe's grove and 20% of all of Farmer Jill's trees. For what positive value of x would the same number of trees be destroyed in both groves?

Not A -> r=10∗60∗24 Not B -> make in equation using each persons number of a's and b's. Not C -> set equations = D because 0.2∗(x+ 10) = .2x which simplifies to 2 = 0 which is never true

Chris receives an email which is supposedly from his Internet Service Provider (ISP). Since Chris is not expecting the email, he is wondering if it is a phishing attack. Which of the following would be the biggest indication that the email was possibly a phishing attempt? Why not this? The email instructs Chris to launch his browser, search for the ISP's website, log in, access the account information screen, and validate/enter his primary telephone number.

This statement prompts Chris to go to the company's website, which is a normal request from a company email. It does not ask Chris to click on a link which could take him to a fake website.

Chris receives an email which is supposedly from his Internet Service Provider (ISP). Since Chris is not expecting the email, he is wondering if it is a phishing attack. Which of the following would be the biggest indication that the email was possibly a phishing attempt? Why not? The body of the email contains the last four digits of Chris' ISP account number.

Typically account information, such as part of the user's account number, are only known by the company itself. However, it is possible that this information is available to a person conducting a phishing attack. However, the possibility of the email being a phishing email is not obvious.

https://admissions.myCollege.edu/student/signin.pdf The beginning of the URL identifies the transfer protocol, in this case https which is immediately followed by a colon. This example also includes the subdomain _______ and folder _______ which includes a document named _______

admissions student signin.pdf

URE controlRobot ( controls ) { FOR EACH num IN controls { IF ( (num MOD 2) = 0 ) { ROTATE_LEFT() } ELSE { IF ( num < 4) { REPEAT num TIMES { MOVE_FORWARD () } } } } [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [ ][ ][ ][ ][ ] [->][ ][ ][ ][ ] which call to controlrobot will cause the robot to short circuit and turn off (leave the barrier) a) (2,1,3,6) b) (3,5,4,1) c) (3,4,6,3) d) (2,3,6,1)

d

cryptography in data

encryption includes a set of techniques for scrambling or disguising data so that it is available only to someone who can restore the data to its original form

how does binary handle an odd number of items in list

examines middle item first

A programmer would like to check whether a temperature is in the 80's (80-89), but not exactly 85. If variable temp is an integer number which represents the temperature, which of the following procedures will implement this logic and return true if this is the case or false otherwise? good or bad PROCEDURE checkTemp ( temp ) { IF ( (temp > 79) AND (temp < 90) ) { IF ( NOT (temp = 85 ) ) { RETURN (true) } } RETURN (false) }

good; assume the use of full numbers

The following is the design for processing a list of vocabulary words related to a unit in AP European History: 1) Assign 1 to an index named i. 2) Assign 0 to an integer number named count. 3) Initialize a list named vocab with all the vocabulary words for the unit. 4) If index i is greater than the number of elements in vocab, then go to step 8. 5) Examine the word at position i and if it contains the word "war" then add 1 to count. 6) Increase index i by one. 7) Go to step 4. 8) Display the value from count. After this algorithm completes execution, which of the following indicates the total number of elements in the list vocab? A count B count - 1 C i D i - 1

i - 1 because i at the end will be 1 + the number of elements in the list

A program should display the index of the first element, in a list named words, that matches searchWord. If searchWord is not found in the list it should display "Not found". Which of the following algorithms will successfully perform this logic? which or which two if not do all algorithms accomplishes this? I i <-- 1 REPEAT UNTIL ( i > LENGTH (words) ) { IF ( words[i] = searchWord ) { DISPLAY (i) i <-- (LENGTH (words) + 1) } ELSE { i <-- i + 1 IF ( i > LENGTH (words) ) { DISPLAY ("Not found") } } } II i <-- LENGTH (words) REPEAT UNTIL ( i = 0 ) { IF ( words[i] = searchWord ) { DISPLAY (i) i <-- 0 } ELSE { i <-- i - 1 IF ( i = 0 ) { DISPLAY ("Not found") } } } III i <-- 1 found <-- -1 REPEAT UNTIL ( i > LENGTH (words) ) { IF ( words[i] = searchWord ) { found <-- i } i <-- i + 1 } IF ( found > -1 ) { DISPLAY (found) } ELSE { DISPLAY ("Not found") }

just I

binary to hex binary number: 10101011

split the binary code from right to left into pairs of four convert each section into it's decimal equivalent and then to its hex equivalent 10101011 1010 : 1011 2+8=10 : 1+2+8=11 10 -> A : 11-> B the answer is *AB*

hex to binary hex number: AB

split the hex code from right to left individually convert each section into it's decimal equivalent and then to its binary equivalent AB A : B A -> 10 : B -> 11 10 in b: 1010 : 11 in b: 1011 the answer is *10101011*


Conjuntos de estudio relacionados

Chapter 8 - Study Guide "The Ancient Egyptian Pharaohs"

View Set

Legal Environment Of Business Exam 1 Review

View Set

PP RNSG 1137 Communications Mastery Quiz

View Set

Chapter 8: Foreign Direct Investment

View Set