CS exit exam practice stuff

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Which of the following are examples of a digital divide? Select all that apply. A.An older couple cannot post messages on a social network site without help from their grandchildren. B.A student is unable to view a video homework assignment because the student does not have access to a high-speed Internet connection. C.A family finds that its broadband Internet connection is slower when the three children in the household simultaneously access the Internet.

A,B

Question: Suppose a computer uses the following encoding scheme to store signed decimal numbers using 4 bits. The signed decimal numbers that can be stored in this manner range from −8 −8 to 7, inclusive. The following table shows the mapping of each decimal number in that range to its corresponding binary representation. To add two decimal numbers using this encoding scheme, each number is first converted to its binary representation. The two binary representations are added, using binary addition. The decimal result is the number corresponding to the binary sum. In this encoding scheme, any overflow digit is ignored. Decimal Number Binary Representation −8) 1000 −7) 1001 −6) 1010 −5) 1011 −4) 1100 −3) 1101 −2) 1110 −1) 1111 0) 0000 1) 0001 2) 0010 3) 0011 4) 0100 5) 0101 6) 0110 7) 0111 For the encoding scheme shown in the table, what decimal number is the result of adding the decimal numbers 5 and 6 ?

-5

Match the four hardware devices with the four classifications. Drag each device to the correct box above its classification. CPU Joystick ROM Speaker B. Joystick Order as 1, least value: D. Speaker Order as 2, second least value: A. CPU Order as 3, second greatest value: C. ROM Order as 4, greatest value: A) Input device B) Output device C) Processing device D) Storage device

1) CPU = Processing device 2) Joystick = Input device 3) ROM = Storage device 4) Speaker = Output device

Which of the following is the decimal representation of the sum of binary numbers 1011 and 1011 ? A.22 B.31 C.44 D.2022

22

A programmer is writing a program to display the even numbers 2 through 10. The program will contain the following statements. Statement Number Pseudocode 1 print ( n ) 2 while ( n ≤ ≤ 10 ) 3 n ← ← n + 2 4 end while 5 int n ← ← 2 Which of the following shows the five numbered statements in correct order so that the program works as intended? A.2, 5, 1, 3, 4 B.2, 5, 3, 4, 1 C.5, 2, 1, 3, 4 D.5, 2, 3, 1, 4

5, 2, 1, 3, 4

A sensor on a refrigerator monitors the temperature and humidity in a room. Consider the following event handler pseudocode segment intended to display "comfortable" if the room climate is comfortable and "uncomfortable" otherwise. The room climate is defined to be comfortable if the temperature is between 62 and 75 degrees Fahrenheit, inclusive, and the humidity is between 30 percent and 50 percent, inclusive. // getTemperature () returns the temperature reading, // in degrees Fahrenheit int temperature ← ← getTemperature () // getHumidityPercent () returns the humidity percent // reading, as an integer between 0 and 100, inclusive int humidity ← ← getHumidityPercent () if ( /* missing expression */ ) print "comfortable" else print "uncomfortable" end if Which of the following could replace /* missing expression */ so that the code segment will work as intended? A. ( temperature ≥ ≥ 62 and temperature ≤ ≤ 75 ) and ( humidity ≥ ≥ 30 and humidity ≤ ≤ 50 ) B. ( temperature ≥ ≥ 62 or temperature ≤ ≤ 75 ) and ( humidity ≥ ≥ 30 or humidity ≤ ≤ 50 ) C. ( temperature ≥ ≥ 62 and temperature ≤ ≤ 75 ) or ( humidity ≥ ≥ 30 and humidity ≤ ≤ 50 ) D. ( temperature ≥ ≥ 62 or temperature ≤ ≤ 75 ) or ( humidity ≥ ≥ 30 or humidity ≤ ≤ 50 )

A

A software engineer is developing a simulation of customers and cashiers in a store for the purpose of better understanding customer wait times. The following information is stored for each customer. Arrival time: the time at which the customer joins a line for a cashier Service time: the time it takes a cashier to complete the customer's order Which of the following is the most appropriate abstract data type to store customer objects in this simulation? A.Customer objects should be placed in a queue data structure in the order of their arrival time. B.Customer objects should be pushed onto a stack data structure in the order of their arrival time. C.Customer objects should be put into a dictionary data structure using the customer's arrival time as the key. D.Customer objects should be put into a dictionary data structure using the customer's service time as the key.

A

Which of the following is an advantage of cloud-based storage? A.It gives users access to files from any Internet-connected device. B.It gives users the greatest control of files. C.It gives users the most secure way to store files. D.It gives users the quickest way to access files.

A

Which of the following is an example of single sign-on (SSO) ? A.Accessing a travel Web site after completing user authentication on a social media Web site B.Entering a user ID and password to access a banking Web site C.Entering an access token sent to a smartphone after entering a user ID and password on an e-mail Web site D.Using a Web browser to store login and password information for various Web sites

A

An e-commerce site asks users to input a shipping address. A United States address consists of the street name and number, the city, the two-character state/territory abbreviation, and the ZIP code. Once the information has been entered, it must be validated. To eliminate some of the validation, the designers decide to ask users to choose the two-character state/territory code from a pull-down menu containing all legal codes. What additional validation must be performed on the state/territory code? A.The state/territory code must be validated against the ZIP code to make sure they form a valid pair. B.The state/territory code must be validated against a database of shipping costs to determine the user's total cost. C.The state/territory code must be validated against a pattern-matching algorithm to make sure it contains the correct characters. D.No additional validation is needed since only state/territory codes from the pull-down menu can be entered.

A

Consider the pseudocode segment with integer variables below, where the arithmetic expression contains mismatched parentheses. int x ← ← ( r + 4 * ( t - 3 ) / 2 Which of the following statements best describes the type of error that would result, in most high-level programming languages, from mismatched parentheses like those in the arithmetic expression? A.The compilation step would fail because of the improper syntax. B.The code would compile but produce an incorrect value for x. C.The code would compile but cause a run-time error due to division by zero. D.The code would compile but cause a rounding error in x for any value of t that is not a multiple of 3.

A

Each employee of a company is assigned a unique identification number. All of the identification numbers are stored using 32 bits. For example, one employee has the identification number 1001 0110 0000 1110 1010 0101 1111 0000. Which of the following statements about the identification numbers is true? A.Writing the greatest possible identification number in hexadecimal requires 8 hexadecimal digits. B.Writing the greatest possible identification number in hexadecimal requires 16 hexadecimal digits. C.Writing the greatest possible identification number in decimal (base 10) requires 5 digits. D.Writing the greatest possible identification number in decimal (base 10) requires 8 digits.

A

Integrated development environments (IDEs) contain programming tools to help developers create software. Which of the following describes an IDE feature and its intended purpose? A.Code completion: Suggests subsequent text based on current text B.Compiler: Maintains a logical ordering of source-code files C.Debugger: Generates API documentation in HTML format D.Interpreter: Optimizes code to minimize the program's running time

A

Question: Although self-driving cars have imperfect driving records, the potential benefits could outweigh the costs. Which of the following statements best explains why research to improve self-driving cars is worthwhile? A.Computers do not get distracted, so the number of traffic collisions due to distracted driving by humans can be reduced. B.Once pedestrians learn to be more careful around self-driving cars, potential injuries will be avoided. C.Self-driving cars will make travel more productive, allowing employees to move farther away from cities. D.Software bugs are to be expected in the beginning, but eventually all the software bugs will be fixed.

A

Question: The Caesar cipher, also known as a shift cipher, encrypts words by replacing each letter in the word with a letter that is a fixed number of positions forward in the alphabet. At the end of the alphabet, the cipher wraps around to the beginning of the alphabet. For instance, with a shift of 2, the word "zoo" is encrypted as "bqq." For a student learning cryptography, which of the following activities best demonstrates the vulnerabilities of the Caesar cipher encryption technique? A.Analyzing the frequency of letters in the encrypted text to show how easy it is to break the Caesar cipher B.Using a program that takes an input message and returns the Caesar cipher encrypted text C.Using public and private key encryption to see how a more-secure encryption algorithm works D.Viewing program code that can both code and decode a message using the Caesar cipher

A

Question: Which of the following data types is the best choice when declaring a variable that will be used to store a worker's hourly wage and that will be used to calculate the worker's total weekly earnings? A.float B.int C.String D.boolean

A

Question: Which of the following is the best way to obtain end-user feedback as part of the process of developing a Web site? A.A/B testing B.Managerial code reviews C.Scrum stand-up meetings D.Unit testing

A

Question: Which of the following statements best describes a difference between code written in a high-level programming language and code written in a low-level programming language? A.Code written in a high-level language can generally make use of more abstractions than code written in a low-level language. B.Code written in a high-level language is generally more difficult to maintain than code written in a low-level language. C.Code written in a high-level language is usually better optimized for particular hardware than code written in a low-level language. D.Code written in a high-level language is usually less portable than code written in a low-level language.

A

Taking massive open online courses (MOOCs) is one example of using the Internet for education. MOOCs allow students from all parts of the world to take a course simultaneously. Some MOOCs are managed by private organizations and others by colleges and universities. Which of the following statements is true about the positive and negative impacts of online learning using MOOCs? A.MOOCs allow virtually unlimited enrollment, but face-to-face communication is limited. B.MOOCs are free and accredited but provide only certificates of completion. C.MOOCs have high course-completion rates, but the number of available courses is limited. D.MOOCs provide one-on-one access to instructors, but access to course materials is only available while the course is in session.

A

Which of the following best describes the main purpose of encoding? A.To format data for efficient storage and transmission B.To maintain data confidentiality C.To minimize data size D.To slow down the transfer of data between computers

A

Which of the following features would be the most beneficial for Deaf people who are accessing a Web site? A.Captions for video media B.Limited use of color contrast and sound to convey meaning C.Alternate text for all images D.An advanced speech synthesizer

A

Which of the following is a factor that affects the size of a digital audio file? A.Bit rate B.Intensity C.Tone D.Volume

A

Which of the following would best be classified as an input device? A.A keyboard B.A monitor C.A pair of speakers D.A printer

A

For the following question, select all the answer choices that apply. Which of the following are impacts of computing? Select all that apply. A.Computing has enabled the creation of interactive art forms. B.Computers analyze images produced by medical imaging devices. C.Computers enable people who speak different languages to communicate.

A,B,C

Which THREE of the following are factors that contribute to the digital divide? A.Different physical access to computers and networks B.Different levels of information literacy C.Different accessibility needs when working with digital technologies D.Different manufacturers of physical digital devices

A,B,C

Place the four items in order from lowest level of abstraction to highest level of abstraction. Drag each item to the correct box. Field Database Record Table Order as 1, least value: Order as 2, second least value: Order as 3, second greatest value: Order as 4, greatest value:

A,C,D,B

To teach students in a Java class about List objects, a teacher gave the students an assignment to design and implement a program that randomly selects cards out of a deck to simulate a five-card-draw poker game. As the students were working on the assignment, the professor received feedback from some of the students. Which of the following pieces of student feedback are reasonable examples of obstacles to equal access to completing the assignment? Select all that apply. A.I've never played cards, so I had to learn how a deck of cards works. B.I struggled with avoiding duplicates in the five-card draw when selecting the cards at random. C.I couldn't figure out how to initialize the deck of cards using a List object. D.I didn't know the rules of five-card-draw poker, so I spent a lot of the time researching poker.

A,D

A computer simulation of operations at a car wash with several wash stations is run several times. In each run of the simulation, only the number of available wash stations is changed. Which of the following changes is most likely to occur between runs of the simulation? A.A change in the average wait time per customer to enter a wash station B.A change in the amount charged per car wash C.A change in the amount of water used per car wash D.A change in the average length of time needed to wash a car once the car enters the wash station

B

A major technology company has millions of users and has collected a great deal of information about them through various means, including surveys and cookies. Which of the following uses of the data would be the most ethical? A.Selling the user data as is to another company B.Requesting that users specifically opt in to sharing data with another company C.Removing personally identifiable information from the data before sharing it with another company D.Including a provision that grants the company the right to sell user data in a lengthy terms of service agreement

B

A program has been stored in memory and is ready to be executed. The three steps in the fetch-decode-execute cycle are shown below. The program counter is a counter that stores the memory location of the next instruction to be executed. Executing the instruction Fetching and decoding the instruction Incrementing the program counter Assume the three-step cycle for the previous instruction has just completed. In which of the following orders must these three steps be performed to complete the next instruction? A.Fetch and decode the instruction; execute the instruction; increment the program counter B.Fetch and decode the instruction; increment the program counter; execute the instruction C.Increment the program counter; execute the instruction; fetch and decode the instruction D.Execute the instruction; increment the program counter; fetch and decode the instruction

B

An employee regularly transfers collections of videos from a recording device to an external hard drive. One day, the total amount of data to be transferred was 30 gigabytes. If the employee used a USB 2.0 connection with a transfer rate of 480 megabits/second, which of the following is closest to the total transfer time needed for the 30 gigabytes of data? (Note: 1 byte = 8 bits; 1 megabit = 220 bits; 1 gigabyte = 230 bytes.) A) 50 seconds B) 8 minutes C) 1 hour D) 5 hours

B

Consider the following incomplete pseudocode procedure, twoInARow, which is intended to simulate rolling a fair 6-sided die multiple times. The procedure has one parameter, numRolls, which is the number of times the die is rolled. The procedure returns the number of pairs of consecutive identical rolls of the die. For example, assume a call to twoInARow ( 8 ) creates the sequence of eight rolls 3, 2, 2, 2, 3, 4, 4, 6. The number of pairs of consecutive identical values in the sequence is 3. The first pair of consecutive identical values is 2 and 2 in the second and third positions in the sequence. The second pair of consecutive identical values is 2 and 2 in the third and fourth positions in the sequence. The third pair of consecutive identical values is 4 and 4 in the sixth and seventh positions in the sequence. Therefore, the call twoInARow ( 8 ) with the given sequence of rolls will return 3. // precondition: numRolls > 0 int twoInARow ( int numRolls ) int numTwoInARow ← ← 0 int temp ← ← 0 for ( int i ← ← 0; i < numRolls; i ← ← i + 1 ) /* missing code block */ end for return numTwoInARow end twoInARow The rolls are simulated using a procedure call RANDOM ( 1, 6 ), which returns a random integer value between 1 and 6, inclusive. Which of the following code segments can replace /* missing code block */ so that procedure twoInARow will work as intended? Select all that apply. A. int roll ← ← RANDOM ( 1, 6 ) if ( roll == temp ) numTwoInARow ← ← numTwoInARow + 1 temp ← ← roll end if B. int roll ← ← RANDOM ( 1, 6 ) if ( roll == temp ) numTwoInARow ← ← numTwoInARow + 1 end if temp ← ← roll C. if ( temp == RANDOM ( 1, 6 ) ) numTwoInARow ← ← numTwoInARow + 1 end if

B

Consider the following pseudocode procedure, where the index of the integer array x starts at 0. // precondition: 0 ≤ y < z < the length of the integer array x int sumItems ( int[] x, int y, int z ) int s ← 0 int i ←y while ( i < z ) s ←s + x[i] i ← i + 1 end while return s end sumItems Consider the following code segment. int[] a ← {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} int r ← sumItems ( a, 2, 5 ) + sumItems ( a, 4, 6 ) What is the value of r after the code segment is executed? answer choices a)17 b)23 c)29 d)24

B

Geofencing is the use of geolocation data to trigger an action when a mobile device crosses a virtual boundary, called a geofence. A student wants to create a smartphone application that uses geofencing to help new students move from one location in a school to another location in the school. Which of the following features of the application might require a heuristic solution? A.The application detects when a student leaves a classroom. B.The application finds the best path from one classroom to the next. C.The application requires login information consisting of a student identification number and password. D.The application retrieves a student's schedule and sends schedule information to the student's smartphone.

B

Q. Which of the following is an example of crowdsourcing? answer choices A)A language-learning platform offers free service to allow anyone to learn a language. B)A language-learning platform builds a collection of documents in a native languages by soliciting aid from users of its Internet service. C)A language-learning platform offers the use of a free language translator that automatically collects data which is used to improve the translator. D)A language-learning platform offers the use of a free language translator that its registered users and then sells the user data for a profit in order to alter other free services.

B

Question: Which of the following is an example of the Internet of Things (IoT) ? A.A driver uses a remote car starter to warm up the car when it is cold outside. B.A coffeemaker in the kitchen turns on when an alarm clock uses the Internet to send it a message. C.A computer automatically runs a daily scan to look for viruses. D.A customer receives an automatically generated e-mail via the Internet for a special discount at a local shop.

B

The pseudocode segment below is intended to count all the even numbers in the integer array numbers, but the code segment contains an error. // precondition: numbers is an array of integers. // precondition: The index of array numbers starts at 0. // precondition: numbers.length returns the length of the array. int count ← ← 0 for ( int i ← ← 0; i ≤ ≤ numbers.length; i ← ← i + 1 ) if ( ( numbers[i] % 2 ) == 0 ) count ← ← count + 1 end if end for Which of the following best describes the error in the code segment? A.Arithmetic precision error B.Array index out-of-bounds error C.Infinite loop error D.Stack overflow error

B

Which of the following is an example of crowdsourcing? answer choices A)A language-learning platform offers free service to allow anyone to learn a language. B)A language-learning platform builds a collection of documents in a native languages by soliciting aid from users of its Internet service. C)A language-learning platform offers the use of a free language translator that automatically collects data which is used to improve the translator. D)A language-learning platform offers the use of a free language translator that its registered users and then sells the user data for a profit in order to alter other free services.

B

Which of the following is the best reason to use named constants instead of hard-coded values in a program? A.To make the program easier for clients to use B.To make the program easier for programmers to maintain C.To make the program execute in less time D.To make the program use less memory

B

Which of the following is the most effective way to prevent a successful cyberattack of a computer system? A.Disable the use of e-mail on the computer system B.Disconnect the computer system from the Internet C.Make sure all security software is up-to-date D.Use a strong password

B

Match the five hardware descriptions with the five hardware acronyms. Drag each description to the correct box next to its acronym. A. A connector and protocol used for communication and power supply B.A component that executes program instructions C. A memory device for temporary storage of data and programs D. A storage device for data and start-up instructions for a computer E. A technology used in flat-screen displays CPU LCD RAM ROM USB

B, E, C, D, A

For each row in the table below, click on the appropriate box to indicate whether the characteristic best applies to lossy or to lossless compression. Characteristic Lossy Compression Lossless Compression Allows perfect reconstruction of the original data from the compressed data lossy(A) lossless(B) Generally achieves a greater compression ratio lossy(c) lossless(d) Is more appropriate for streaming music and video lossy(e) lossless(F)

B,C,E

Consider the following two equivalent algorithms, which calculate and return the same value. Algorithm 1 int f ( int n ) int a ← ← 1 int b ← ← 1 while ( n ≥ ≥ 3 ) int temp ← ← a + b a ← ← b b ← ← temp n ← ← n - 1 end while return b end f Algorithm 2 int g ( int n ) if ( n ≤ ≤ 2 ) return 1 else return g ( n - 1 ) + g ( n - 2 ) end if end g Which of the following best describes the running times of algorithm 1 and algorithm 2 in terms of n ? Algorithm 1Algorithm 2 A.Linear Linear B.Linear Exponential C.Quadratic Linear D.Quadratic Exponential

B.

. A software application that sends encrypted data over the Internet uses a popular pseudorandom number generator. The application uses a seed value of 1024. Which of the following statements about the application must be true? answer choices A)The length of the key used to encrypt the data is 1024 bits. B)The sequence of random numbers generated will repeat every 1024 numbers. C)The sequence of random numbers generated by all instances of the application will be the same because pseudorandom number generators are deterministic. . D)Increasing the seed value of 1024 to 2048 would make the application's data significantly more resistant to hacking.

C

A city is conducting a census. A variety of data are collected from each household in the city, including information about incomes, levels of education, ages, and races of the members of the household. However, to be anonymous, names and addresses are not collected. Which of the following best describes a valid visualization of the census data using a spreadsheet? answer choices A)Using a spreadsheet chart, the total number of college graduates living on each street in the city could be reported. B)Using the filter feature in the spreadsheet, all ages could be converted to birth years C)Using a spreadsheet formula, the average income per household could be estimated. D)Using the column sort feature in the spreadsheet, the oldest person could be identified.

C

Which of the following software license agreements allows users to use, modify, and sell or give away source code without the payment of royalties to the original developer? A.Creative Commons Attribution-NoDerivs license B.End-user license C.Open-source license D.Proprietary license

C

A programmer has written a procedure wa ( x, y, w ) to calculate the weighted average of two values x and y. In the procedure, the given weight w is applied to the greater of x and y, and the remaining weight 1 - w is applied to the smaller of x and y. An application calls the procedure on a pair of values a and b and then on a different pair of values c and d. Both calls use the same weight w. The final step in the application's algorithm is to call wa on the results of the previous two procedure calls, again using the same weight w. Which of the following correctly uses wa to calculate the desired result? A.wa ( wa ( a, b ), wa ( c, d ), w ) B.wa ( wa ( a, b, w ), wa ( c, d, w ) ) C.wa ( wa ( a, b, w ), wa ( c, d, w ), w ) D.wa ( wa ( a, b, w ) + wa ( c, d, w ) )

C

A software developer is designing a simulation of city street traffic over a 24-hour period. As part of the design, the simulation will use a variable that represents the amount of time, in hours, that elapses between the entry of successive cars onto the street. During a run of the simulation, which of the following best describes what values should be assigned to the variable in order to create the most realistic simulation? A.Values that decrease linearly during the simulation B.Values that increase exponentially during the simulation C.Values that oscillate during the simulation above and below a specified mean D.Values randomly generated during the simulation that are integers between 1 and 23, inclusive

C

ASCII is a character encoding standard that uses 7-bit binary numbers to represent each character. The following table shows four ASCII characters and the decimal number associated with each character. ASCII Character Decimal Number 7 55 = 61 A 65 Z 90 For which of the following ASCII characters does the associated 7-bit binary number contain the greatest number of 0s? A.7 B.= C.A D.Z

C

Consider the following pseudocode procedure, which is intended to return true if a positive integer greater than 1 is prime and to return false otherwise. A prime number has only two positive factors: 1 and itself. boolean isPrime ( int n ) if ( n < 2 ) return false end if int k ← ← 2 /* missing code */ end isPrime Which of the following can replace /* missing code */ so that isPrime works as intended? A. while ( k < n ) if ( ( n % k ) == 0 ) return false else return true end if k ← ← k + 1 end while B. while ( k < n ) if ( ( n % k ) ≠ ≠ 0 ) return true end if k ← ← k + 1 end while return false C. while ( k < n ) if ( ( n % k ) == 0 ) return false end if k ← ← k + 1 end while return true D. int count ← ← 0 while ( k ≤ ≤ n ) if ( ( n % k ) == 0 ) count ← ← count + 1 end if end while return ( count == 1 )

C

In an online scam, a bank customer receives an e-mail warning of suspicious activity on the customer's account. The e-mail asks the customer to click on a link in the e-mail, which, the e-mail claims, will allow the customer to log into his or her account and verify his or her identity. The e-mail has the look and feel of a legitimate e-mail, but the link points to a malicious Web site. Which of the following best describes the scam? A.Spam B.Hacking C.Phishing D.Robocalls

C

Question: A homeowner wants to determine how changes in temperature affect the relative humidity in the homeowner's basement. The homeowner installs a sensor in the basement that monitors the temperature and relative humidity and sends the data to the homeowner's smartphone every hour. After collecting the data for 48 hours, the homeowner enters the data into a spreadsheet program. Which of the following visualizations is the most appropriate for the analysis of the data? A.A histogram showing the number of times the sensor reported temperature values in various ranges and a histogram showing the number of times the sensor reported humidity values in various ranges B.A pie chart showing the proportion of time the sensor reported temperature values in various ranges and a pie chart showing the proportion of time the sensor reported humidity values in various ranges C.A scatterplot using temperature as the independent variable and the humidity as the dependent variable D.A time series plot using time as the independent variable and temperature as the dependent variable and a time series plot using time as the independent variable and humidity as the dependent variable

C

Question: A traveler is keeping a digital photo journal. When the journal is ready, it will be posted on an Internet Web site that offers controlled access. Which of the following presents the greatest risk to the traveler's privacy? A.Posting the journal using HTTP B.Posting the journal using HTTPS C.Posting the journal using public Wi-Fi and HTTP D.Posting the journal using public Wi-Fi and HTTPS

C

Two people with access to the same bank account made two separate withdrawals from the account. They made the withdrawals at the same time but at two separate bank branches. At the time of the withdrawals, the account had $400. Both people checked the account balance before making their withdrawal and saw that it was $400. One person withdrew $200, and the other person withdrew $250. Both transactions were successful. Later, the two people each received an e-mail from the bank saying that the account was overdrawn. Which of the following best describes the error in the bank software that caused this problem? A.The bank software failed to correctly authenticate and authorize the users accessing the account. B.The bank software erroneously allowed multiple tasks to be running at the same time. C.The bank software erroneously allowed two different processes to access shared data at the same time. D.The bank software erroneously used virtual memory instead of physical memory to store the data.

C

Using 8-bit ASCII, the 2-character string message "Hi" is encoded as 01001000 01101001. If each 8-bit binary code of the message is encrypted using the 8-bit key 11010011 and an XOR operation, which of the following represents the encrypted message? A.00011011 00111100 B.00100001 10111010 C.10011011 10111010 D.11011011 11111011

C

Which of the following best describes an essential characteristic that can be used to distinguish a recursive algorithm from a nonrecursive algorithm? A.Being implemented with a procedure or method that has one parameter B.Creating and initializing an accumulator to store the result while the algorithm is running C.Making progress toward a solution by running the algorithm on a smaller version of the original problem D.Returning a fixed, literal value in the simplest case or cases

C

Which of the following best describes the average running time of a linear search algorithm and a binary search algorithm on a sorted array of integers, in terms of the length of the array? Linear SearchBinary Search A.Logarithmic Logarithmic B.Logarithmic Linear C.Linear Logarithmic D.Linear Linear

C

Which of the following best describes an appropriate use of a wireless communication technology? answer choices A)Using Bluetooth on a boat to call rescue vessels B)Using cellular communication in a sparsely populated area to connect to a mobile device to the Internet. C)Using satellite communication to connect a wireless keyboard to a nearby computer D)Using Wi-Fi to connect to a laptop and router within a house

D

Which of the following best describes how network load and latency change as more devices are connected to the Internet in a home network? A.Both the network load and the latency decrease. B.The network load decreases and the latency increases. C.The network load increases and the latency decreases. D.Both the network load and the latency increase.

D

Which of the following is a primary difference between encoding and encryption? A.Encoding involves binary digits and encryption does not. B.Encoding transforms data and encryption does not. C.Encryption is used in online transactions and encoding is not. D.Encryption is used to restrict access and encoding is not.

D

A programmer wrote the following pseudocode segment. Assume that int variables are stored as 32-bit two's complement binary numbers. int populationX ← ← 1310000000 int populationY ← ← 1370000000 int totPopulation ← ← populationX + populationY print ( "Total population = " ) print ( totPopulation ) // print at the end // of the previous output line When executed, the program produces the following line of output. Total population = -1614967296 The negative value surprises the programmer. Which of the following best explains the unexpected negative value? A.The use of intermediate variables populationX and populationY introduces errors into the addition operation. B.The names of the variables used to store population values are too long. C.A round-off error occurred as a result of the addition operation. D.The sum of the two populations exceeds the largest value that can be stored in a variable of type int.

D

A teacher wants to arrange 32 students in groups of 4 using the following process. Each student in the class ranks the other students in order of preference. After finding all possible groups of 4, the ranking data are used to determine the average of each group member's satisfaction with other group members to determine the best possible solution, which consists of the highest average satisfaction rating for all students. In a class of 32 students, there are approximately 5.9× 10 19 5.9×1019 different possible groupings. Which of the following best describes the computational limitations of a program designed to implement this process? A.Finding the best possible solution is impossible, since there are so many possibilities to consider. B.Finding an optimal solution is impossible, since no algorithm exists that can solve the problem exactly. C.Finding an optimal solution is difficult, since the data cannot easily be stored in a digital format. D.Finding an acceptable solution using a heuristic approach is possible, but the solution may differ from the best possible solution.

D

An algorithm was written for drawing the part of a line segment that lies within a given drawing window. The algorithm takes advantage of the fact that there are simple tests to determine if a line segment lies entirely inside or outside the window. For efficiency, the algorithm only finds where a line segment intersects the window's border when these tests are both negative. This algorithm is representative of which of the following common approaches to solving problems? A.Building a solution by combining small pieces of the solution one at a time and in sequence B.Expressing a solution of a large problem in terms of the solutions of smaller, similarly structured problems C.Guessing a solution, using a measure of error to refine that initial estimate, and then repeating the process with the new guess D.Solving easy cases first and hard cases only when necessary

D

Consider a plaintext string that consists of uppercase letters. A certain encryption algorithm replaces each letter in the string with a cipher text letter to create a cipher text string as follows. The algorithm selects the letter that is to be replaced. Using the uppercase English alphabet, the algorithm moves a fixed number of positions from the selected letter, in increasing alphabetical order. If the algorithm reaches the end of the English alphabet, it wraps around and continues from the beginning of the alphabet. Consider the following line of code, which implements the replacement of the selected plaintext uppercase letter ltr, where offset is the fixed number of positions. ltr ← ( ( ( ltr - 'A' ) + offset ) % 26 ) + 'A' If offset has the value 3 and the plaintext string has the value "SAY", what is the value of the cipher text string produced by the algorithm? A)"PXV" B)"RZX" C)"TBZ" D)"VDB"

D

Consider the following incomplete procedure, which is intended to return the index of the smallest element in the nonempty integer array data. The index of the first element of data is 0 and length is the number of elements in data. For example, if the value of array data is {6, 7, 8, 1, 9}, the procedure is intended to return 3, the index of the array element that contains the smallest value, 1. If there are duplicates of the smallest value in the array, then the procedure returns the index of the first occurrence of the smallest value. int positionOfSmallestValue ( int[] data, int length ) int guess ← ← 0 for ( int i ← ← 1; i < length; i ← ← i + 1 ) /* missing code segment */ end for return guess end positionOfSmallestValue Which of the following code segments could replace /* missing code segment */ so that positionOfSmallestValue works as intended? A. if ( data[i] < guess ) guess ← ← data[i] end if B. if ( data[i] < guess ) data[i] ← ← guess end if C. if ( data[i] < data[guess] ) i ← ← guess end if D. if ( data[i] < data[guess] ) guess ← ← i end if

D

Consider the following method for a class Closet. Assume Closet objects contain Hanger objects and Shoe objects. Method : void update ( int z, String w ) Explanation : Adds Hanger or Shoe objects to the Closet object. If the value of w is "a", then z Hanger objects are added. If the value of w is "r", then z Shoe objects are added. Otherwise, nothing is done. Given that a Closet object myCloset has been declared and initialized, which of the following method calls is the correct way to add 10 Shoe objects to myCloset ? answer choicesa A)myCloset.update ( 10, "a" ) B)myCloset.update ( "a", 10 ) C) myCloset ←update ( 10, "r" ) D) myCloset.update ( 10, "r" )

D

Consider the following pseudocode procedure header. int average ( int a, int b, int c ) Which of the following is a valid call to the procedure average ? A.average ( 3, 4 ) B.average ( "2", 3, 4 ) C.average ( 2.5, 5, 6 ) D.average ( average ( 1, 2, 3 ), 4, 5 )

D

Consider the pseudocode procedure below, which implements a binary search on integer array arr. The parameter length is the length of array arr and the parameter target is the value to be searched for. The index of array arr starts at 0. In line 5, the symbol / represents integer division. Line 01: int binarySearch ( int[] arr, int length, int target ) Line 02: int lo ← ← 0 Line 03: int hi ← ← length - 1 Line 04: while ( lo ≤ ≤ hi ) Line 05: int mid ← ← lo + ( hi - lo ) / 2 Line 06: if ( arr[mid] > target ) Line 07: hi ← ← mid - 1 Line 08: else Line 09: if ( arr[mid] < target ) Line 10: lo ← ← mid + 1 Line 11: else Line 12: return mid Line 13: end if Line 14: end if Line 15: end while Line 16: return -1 Line 17: end binarySearch Consider the following code segment. int[] arr ← ← {-3, -2, 1, 2, 3, 4, 5, 6, 7, 9} int length ← ← 10 int target ← ← 4 int z ← ← binarySearch ( arr, length, target ) When the call to binarySearch is executed, what value is returned and how many total comparisons are executed? (Comparisons are executed in lines 4, 6, and 9.) Value ReturnedTotal Number of Comparisons A.-15 B.-18 C.55 D.58

D

Consider the pseudocode procedure power below, which, given integer inputs x and y, returns the value of x raised to the y power. int power ( int x, int y ) int answer ← ← 1 for ( int count ← ← 0; count < y; count ← ← count + 1 ) answer ← ← answer * x end for return answer end power Under which of the following conditions does the power procedure always fail to produce the correct answer? A.When the base value x is negative and the exponent value y is positive B.When the base value x is zero and the exponent value y is greater than or equal to 2 C.When the base value x is positive and the exponent value y is zero D.When the base value x is greater than or equal to 2 and the exponent value y is negative

D

The general form of an Internet protocol version 4 (IPv4) address is nnn.nnn.nnn.nnn, where nnn is an 8-bit integer. The general form of an Internet protocol version 6 (IPv6) address is: HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH, where each H is a hexadecimal digit. Which of the following is a true statement about the relationship between the number of possible IPv4 addresses and the number of possible IPv6 addresses? answer choices A) There are 4 times as many possible IPv6 addresses as possible IPv4 addresses. B) There are 24 times as many possible IPv6 addresses as possible IPv4 addresses. C) There are 296times as many possible IPv6 addresses as possible IPv4 addresses. D) There are 264times as many possible IPv6 addresses as possible IPv4 addresses.

D

What is the maximum number of distinct symbols that could appear in the hexadecimal representation of a positive integer? A.8 B.10 C.15 D.16

D

Which of the following best describes a situation in which a heuristic should be used to find a solution? A.An accountant is calculating the taxes of her clients. B.A researcher is compiling the results from three separate research groups into one list. C.A nurse is determining the correct dosage of medications for a patient based on his age and weight. D.A family is planning a cross-country road trip and wants a route that avoids roads at times they are normally congested.

D

Which of the following is most likely to be permitted as fair use? A.A small-business owner uses copyrighted music in an advertisement on a social media Web site. B.A student uses an image from a Web site for a research project without documenting its source. C.A teacher digitizes a computer science textbook and posts it to an electronic blackboard. D.A teacher shows a two-minute video clip of a movie illustrating a concept the class had just discussed.

D

Which of the following network devices is responsible for finding and changing the paths of data packets as needed? A.Network firewall B.Network interface card C.Network repeater D.Network router

D

Why might a developer embed a script in HTML code answer choices A)Because scripts are needed to control presentation of content styles. B)Because scripts are needed to protect the copyrights of a page. C)Because scripts are needed to provide semantic markup of the content. D)Because scripts are needed to support dynamic Web page behavior.

D

Answer the question below by clicking on the correct response. Question: Consider the following pseudocode procedure, which is intended to return the index of the least element in an array of integers data[0..n-1] of length n. If the least element in the array data occurs at multiple positions, the lowest index is returned. // precondition: n > 0 public int positionOfMinimum ( int[] data, int n ) int startingPosition ← ← 0 int bestGuessSoFar ← ← startingPosition for ( int i ← ← startingPosition + 1; i < n; i ← ← i + 1 ) if ( data[i] < data[bestGuessSoFar] ) bestGuessSoFar ← ← i end if end for return bestGuessSoFar end positionOfMinimum Sometimes, it is necessary to search only part of an array. Of the following, which describes the most general solution for updating positionOfMinimum so that only the part of the array that begins at a specified index is searched? A.Make startingPosition a parameter of the method and remove the line that declares startingPosition and initializes it to 0. B.Change the for loop to a while loop that only executes while the code is searching the correct part of the array. C.Add a second if statement to the method that checks that the index found is in the correct part of the array. D.Change the initial value of startingPosition to the value of the index in the array where the search should begin.

Make startingPosition a parameter of the method and remove the line that declares startingPosition and initializes it to 0.

Writers and graphic artists are working to develop illustrations for a children's book. Which of the following aspects of the creative process has been most significantly enhanced by the availability of software? A.Determining the layout, size, and number of illustrations B.Designing sketches to illustrate the author's concepts C.Selecting sketches to recommend for each illustration D.Sharing illustrations among all the artists and writers to obtain feedback

Sharing illustrations among all the artists and writers to obtain feedback

Consider the following pseudocode procedure, where the length of each of the two integer arrays A and B is n and the first index of each of the two arrays is 0. void mystery ( int[] A, int[] B, int n ) int i ← ← 0 for ( int k ← ← 0; k < n; k ← ← k + 1 ) if ( A[i] > B[k] ) A[i] ← ← B[k] else i ← ← i + 1 end if end for end mystery Consider the following pseudocode segment. int[] c ← ← {7, 6, 8, 10} int[] d ← ← {8, 6, 7, 5} mystery ( c, d, 4 ) What is the value of c after the code segment above is run? A.{7, 6, 5, 10} B.{7, 6, 7, 5} C.{7, 6, 7, 10} D.The code causes an array index out-of-bounds error.

{7, 6, 5, 10}


Set pelajaran terkait

Глава 1: Знакомство с колледжем

View Set

Coronary artery disease and acute coronary syndrome questions

View Set

AP Lang: MCQ practice for midterm

View Set

Mortgage Practice Questions 501-550

View Set

Chapter 12: Media Access Control (MAC)

View Set