CompSci Review

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Which of the following are true statements about how the Internet enables crowdsourcing? I. The Internet can provide crowdsourcing participants access to useful tools, information, and professional knowledge. II. The speed and reach of the Internet can lower geographic barriers, allowing individuals from different locations to contribute to projects. III. Using the Internet to distribute solutions across many users allows all computational problems to be solved in reasonable time, even for very large input sizes.

(A) I and II only

Which of the following explains a benefit of using open standards and protocols for Internet communication?

(A) Open standards and protocols allow different manufacturers and developers to build hardware and software that can communicate with hardware and software on the rest of the network.

Which of the following are ways in which a programmer can use abstraction to manage the complexity of a program? Select two answers.

(A) Replacing each instance of repeated code with a call to a procedure (D) Replacing the string variables name1, name2, name3, and name4 with a list of strings called names

An online retailer uses an algorithm to sort a list of n items by price. The table below shows the approximate number of steps the algorithm takes to sort lists of different sizes. Based on the values in the table, which of the following best characterizes the algorithm for very large values of n ?

(A) The algorithm runs in reasonable time.

Two different schools maintain data sets about their currently enrolled students. No individual student is enrolled at both schools. Each line of data contains information, separated by commas, about one student. East High School stores the data in the following format. West High School stores the data in the following format. The two schools would like to combine their data to make a single data set. Which of the following can be done with the combined data? Select two answers.

(A) The schools can create a single list of student names, sorted by last name. (B) The schools can determine the average number of days students are absent.

Which of the following best describes the purpose of machine learning programs?

(A) To analyze large data sets, recognize patterns, and make predictions based on data

A flowchart is a way to visually represent an algorithm. The flowchart below is used by an apartment rental Web site to set the variable include to true for apartments that meet certain criteria. Which of the following statements is equivalent to the algorithm in the flowchart?

(A) include ← (floor > 10) OR (bedrooms = 3)

Which of the following statements describe how cloud computing has affected Internet communication? Select two answers.

(B) Cloud computing has helped enhance collaboration. (C) Cloud computing has introduced new data-security concerns.

A program contains the following procedures for string manipulation. Which of the following expressions can be used to generate the string "Happy" ?

(B) Concat (Substring ("Harp", 1, 2), Substring ("Puppy", 3, 3))

Which of the following is an example of symmetric encryption?

(B) Finn and Gwen develop a system that maps each letter of the alphabet to a unique symbol using a secret key. Finn uses the key to write a message to Gwen where each letter is replaced with the corresponding symbol. Gwen uses the key to map each symbol back to the original letter.

A computer program uses 4 bits to represent nonnegative integers. Which of the following statements describe a possible result when the program uses this number representation? I. The operation 4+8 will result in an overflow error. II. The operation 7 + 10 will result in an overflow error. III. The operation 12 + 3 will result in an overflow error.

(B) II only

The procedure below searches for the value target in list. It returns true if target is found and returns false otherwise. Which of the following are true statements about the procedure? I. It implements a binary search. II. It implements a linear search. III. It only works as intended when list is sorted.

(B) II only

The program below is intended to count the number of prime numbers in a list called numbers and display the result. The program uses the procedure isPrime (n), which returns true if n is a prime number and false otherwise. The program does not work as intended. Which two lines of code should be removed so that the program will work as intended? Select two answers.

(B) Line 4 (D) Line 9

Which of the following statements accurately describe the hierarchy of the Web pages example.org and about.example.org ? Select two answers.

(B) The Web page about.example.org is a subdomain of example.org. (C) The Web page example.org is a domain under the top-level domain .org.

A computer program performs the operation 2÷3 and represents the result as the value 0.6666667. Which of the following best explains this result?

(B) The precision of the result is limited due to the constraints of using a floating-point representation.

A media librarian at a movie studio is planning to save digital video files for archival purposes. The movie studio would like to be able to access full-quality videos if they are needed for future projects. Which of the following actions is LEAST likely to support the studio's goal?

(B) Using lossy compression software to reduce the size requirements of the data being stored

A program is created to perform arithmetic operations on positive and negative integers. The program contains the following incorrect procedure, which is intended to return the product of the integers x and y. A programmer suspects that an error in the program is caused by this procedure. Under which of the following conditions will the procedure NOT return the correct product? Select two answers.

(B) When the value of x is positive and the value of y is negative. (D) When the values of x and y are both negative.

A programmer is writing a procedure to calculate a student's final grade in the course using the score replacement policy described. The student's exam scores are stored in the variables midtermExam and finalExam. The procedure Max (a, b) returns the larger of a and b. Which of the following could be used in the procedure to calculate a student's total points earned in the course and store the result in the variable adjustedTotal?

(B) adjustedTotal ← Max (midtermExam, finalExam) + finalExam

The code segment below is intended to display all multiples of 5 between the values start and end, inclusive. For example, if start has the value 35 and end has the value 50, the code segment should display the values 35, 40, 45, and 50. Assume that start and end are multiples of 5 and that start is less than end. Line 1: i ← start Line 2: REPEAT <MISSING EXPRESSION> TIMES Line 3: { Line 4: DISPLAY (i) Line 5: i ← i+5 Line 6: } Which of the following could replace <MISSING EXPRESSION> in line 2 so that the code segment works as intended?

(C) ((end - start) / 5) + 1

Color is often represented by a 6-digit hexadecimal number that describes how the colors red, green, and blue are mixed to create the desired color. From left to right, the first two digits represent the amount of red, the second two digits represent the amount of green, and the last two digits represent the amount of blue. Which of the following hexadecimal numbers represents the color with the greatest amount of blue in it?

(C) A100B0

The two code segments below are each intended to display the average of the numbers in the list numList. Assume that numList contains more than one value. Which of the following best describes the two code segments?

(C) Both code segments display the correct average, but code segment I requires more arithmetic operations than code segment II.

The following programs are each intended to move the robot to the gray square. Program II uses the procedure GoalReached, which returns true if the robot is in the gray square and returns false otherwise. Which of the following statements is true?

(C) Both program I and program II correctly move the robot to the gray square.

Which of the following describes how a distributed denial-of-service (DDoS) attack is most likely to compromise an online store's Web site?

(C) By preventing customers from placing orders

A NAND gate is a type of logic gate that produces an output of false only when both of its two inputs are true. Otherwise, the gate produces an output of true. Which of the following Boolean expressions correctly models a NAND gate with inputs P and Q ?

(C) NOT (P AND Q)

A free online encyclopedia contains articles that can be written and edited by any user. Which of the following are advantages the online encyclopedia has over a traditional paper-based encyclopedia? Select two answers.

(C) The ability to have a larger number of perspectives reflected in the encyclopedia content (D) The ability to quickly update encyclopedia content as new information becomes available

The procedure Smallest is intended to return the least value in the list numbers. The procedure does not work as intended. For which of the following values of theList will Smallest (theList) NOT return the intended value? Select two answers.

(C) theList ← [30, 40, 20, 10] (D) theList ← [40, 30, 20, 10]

A snack bar has a frequent customer program in which every 10th purchase is free. Customers are enrolled in the program when they make their first purchase. A programmer is writing a program to implement a frequent customer program. In one code segment, the cost is set to 0 for every 10th purchase by a given customer. The programmer will use the procedure GetCount (customerID), which returns the total number of purchases a customer has made since enrolling in the frequent customer program, including his or her first purchase. Which of the following code segments will set cost to 0 for every 10th purchase a customer makes after enrolling in the frequent customer program?

(C)count ← GetCount (customerID) IF (count MOD 10 = 0) { cost ← 0 }

Internet protocol version 4 (IPv4) represents each IP address as a 32-bit binary number. Internet protocol version 6 (IPv6) represents each IP address as a 128-bit binary number. Which of the following best describes the result of using 128-bit addresses instead of 32-bit addresses?

(D) 2^96 times as many addresses are available.

Which of the following describes a benefit of using hexadecimal numbers instead of binary numbers to represent data?

(D) A hexadecimal representation of a value generally requires fewer digits than a binary representation of the same value.

The teacher has data representing the scores of thousands of students. For each student, the data contain the student name, the midterm exam score, the final exam score, and the result of the total points calculation. Which of the following could be determined from the data? I. The average total points earned per student II. The average increase in total points per student as a result of the score replacement policy III. The proportion of students who improved their total points as a result of the score replacement policy

(D) I, II, and III

A programmer is developing a word game. The programmer wants to create an algorithm that will take a list of words and return a list containing the first letter of all words that are palindromes (words that read the same backward or forward). The returned list should be in alphabetical order. For example, if the list contains the words ["banana", "kayak", "mom", "apple", "level"], the returned list would contain ["k", "l", "m"] (because "kayak", "level", and "mom" are palindromes). The programmer knows that the following steps are necessary for the algorithm but is not sure in which order they should be executed. Executing which of the following sequences of steps will enable the algorithm to work as intended? I. First shorten, then keep palindromes, then sort II. First keep palindromes, then shorten, then sort III. First sort, then keep palindromes, then shorten

(D) II and III

A student wants to create an algorithm that can determine, given any program and program input, whether or not the program will go into an infinite loop for that input. The problem the student is attempting to solve is considered an undecidable problem. Which of the following is true?

(D) It is not possible to create an algorithm that will solve the problem for all programs and inputs.

The latency of a network connection is most appropriately measured with which of the following units?

(D) Milliseconds

A programmer notices the following two procedures in a library. The procedures do similar, but not identical, things. • Procedure Square (n) returns the value n^2 • Procedure Cube (n) returns the value n^3 Which of the following procedures is a generalization of the procedures described above?

(D) Procedure Power (n, m), which returns the value n^m

In a certain science experiment, 75 percent of trials are expected to be successful and 25 percent of trials are expected to be unsuccessful. The program below is intended to simulate the results of repeated trials of the experiment. Which of the following can be used to replace <MISSING CODE> so that the simulation works as intended?

(D) RANDOM (1, 100) ≤ 75

38. A researcher wrote a program to simulate the number of mice in an environment that contains predators. The program uses the following procedures. Based on the code, which of the following assumptions is made in the simulation?

(D) The number of predators does not change from day to day.

A student wrote the procedure below, which is intended to ask whether a user wants to keep playing a game. The procedure does not work as intended. Which of the following best describes the result of running the procedure?

(D) The procedure returns false no matter what the input value is.

Consider the following program. Which of the following describes the result of executing the program?

(D) The program displays the sum of the odd integers from 1 to 19.

In public key cryptography, the sender uses the recipient's public key to encrypt a message. Which of the following is needed to decrypt the message?

(D) The recipient's private key

A musician is creating a song using audio samples. Which of the following actions will minimize the risk of a copyright violation when creating sample-based music?

(D) Using samples published with a no-rights-reserved Creative Commons license

The data from the survey are represented in the graph below. Each × represents a survey participant who said he or she was interested in the application, and each O represents a participant who said he or she was not interested.Which of the following hypotheses is most consistent with the data in the graph?

Participants who read more were generally more likely to say they are interested in the application.


Ensembles d'études connexes

Unit 13: THE civil war Required reading: BRINKLEY, CH. 14

View Set

Psych 305 Exam 2 Part 2: Chapter 6 & 7

View Set

THE ULTIMATE TEAS COMBINATION EAT YOUR HEART OUT (ONLY SOME SCIENCE)llu

View Set

Chapter 3: Medical Expenses Insurance

View Set

Chapter 14: Nursing Management During Labor and Birth

View Set

Chapter 10- Complete 20 hours of Training

View Set

Vocab Workshop - Level A - Unit 11 - Choosing the Right Word JPJ

View Set