Exam Review

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

A retailer that sells footwear maintains a single database containing records with the following information about each item for sale in the retailer's store. Item identification number Footwear type (sneakers, boots, sandals, etc.) Selling price (in dollars) Size Color Quantity available Using only the database, which of the following can be determined?

(A) Which items listed in the database are not currently in the store

Digital images are often represented by the red, green, and blue values (an RGB triplet) of each individual pixel in the image. A photographer is manipulating a digital image and overwriting the original image. Which of the following describes a lossless transformation of the digital image?

(C) Creating the negative of an image by creating a new RBG triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed.

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the bottom-left square of the grid and facing toward the top of the grid. Code for the procedure Mystery is shown below. Assume that the parameter p has been assigned a positive integer value (e.g., 1, 2, 3, ...). Which of the following shows a possible result of calling the procedure?

A

A summer camp offers a morning session and an afternoon session. The list morningList contains the names of all children attending the morning session, and the list afternoonList contains the names of all children attending the afternoon session. Only children who attend both sessions eat lunch at the camp. The camp director wants to create lunchList, which will contain the names of children attending both sessions. The following code segment is intended to create lunchList, which is initially empty. It uses the procedure IsFound (list, name), which returns true if name is found in list and returns false otherwise. Which of the following could replace <MISSING CODE> so that the code segment works as intended?

A -

A flowchart is a way to visually represent an algorithm. The flowchart below uses the following building blocks. What is displayed as a result of executing the algorithm in the flowchart?

A - 5

A computer program uses 3 bits to represent integers. When the program adds the decimal (base 10) numbers 5 and 3, the result is 0. Which of the following is the best explanation for the result?

A - An overflow error occurred

The figure below shows a circuit composed of two logic gates. The output of the circuit is true. Which of the following is a true statement about input A?

A - Input A must be true.

A user enters a Web address in a browser, and a request for a file is sent to a Web server. Which of the following best describes how the file is sent to the user?

A - The file is broken into packets for transmission. The packets must be reassembled upon receipts.

The diagram below shows a circuit composed of two logic gates labeled OR and AND. Each gate takes two inputs and produces a single output. If the inputs A and C are both true, which of the following best describes the output of the AND gate?

A - The output will be true no matter what the value of input B is.

A student is recording a song on her computer. When the recording is finished, she saves a copy on her computer. The student notices that the saved copy is of lower sound quality than the original recording. Which of the following could be a possible explanation for the difference in sound quality?

A - The song was saved using fewer bits per second than the original song.

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

A - about.example.com

Consider the following code segment. Which of the following replacements for <MISSING CONDITION> will result in an infinite loop?

A - j=6

A program is expressed in a programming language. Which of the following is true of the program?

A. The program can also be expressed as binary code, but will be more easily understood by humans when expressed in a higher-level programming language.

A code segment will be used to swap the values of the variables a and b using the temporary variable temp. Which of the following code segments correctly swaps the values of a and b ?

B

The procedure Draw (length, direction) is used to draw a line segment length units long in a given direction (left, right, up, or down), starting at the current cursor position. The cursor is then repositioned at the end of the line segment that was drawn. Consider the following program, where the cursor starts in the upper left corner of a grid of dots. The dots are spaced one unit apart. Draw (1, right) Draw (2, down) Draw (1, left) Draw (1, right) Draw (1, up) Draw (1, left) Which of the following represents the figure that is drawn by the program?

B

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the center square of the grid and facing toward the top of the grid. The following code segment is used to move the robot within the grid. Which of the following represents all possible final locations for the robot?

B

An office building has two floors. A computer program is used to control an elevator that travels between the two floors. Physical sensors are used to set the following Boolean variables. The elevator moves when the door is closed and the elevator is called to the floor that it is not currently on. Which of the following Boolean expressions can be used in a selection statement to cause the elevator to move?

B - (onFloor1 AND callTo2) OR (onFloor2 AND callTo1)

In the program below, y is a positive integer (e.g., 1, 2, 3, ...) Picture What is the value of result after running the program?

B - 3y

Consider the code segment below. If the variables onTime and absent both have the value false, what is displayed as a result of running the code segment?

B - Better late than never

Consider the following numbers. Binary 1100 Decimal 11 Hexadecimal D Which of the following lists the numbers in order from least to greatest?

B - Decimal 11, Binary 1100, Hexadecimal D

A programmer is deciding between using a linear or binary search to find a target value in a sorted list. Which of the following is true?

B - Generally, the advantage of using a binary search over a linear search increases as the size of the list increases.

A programmer is writing a program that is intended to be able to process large amounts of data. Which of the following considerations is LEAST likely to affect the ability of the program to process larger data sets?

B - How many programming statements the program contains

A large data set contains information about all students majoring in computer science in colleges across the United States. The data set contains the following information about each student. The student's gender The state in which the student attends college The student's grade point average on a 4.0 scale Which of the following questions could be answered by analyzing only information in the data set?

B - How many states have computer science as the most common major for female students?

Many Web browsers allow users to open anonymous windows. During a browsing session in an anonymous window, the browser does not record a browsing history or a list of downloaded files. When the anonymous window is exited, cookies created during the session are deleted. Which of the following statements about browsing sessions in an anonymous window is true?

B - Items placed in a Web store's shopping cart for future purchase during the anonymous browsing session will not be saved on the user's computer.

The code segment below uses the procedure IsFound (list, item), which returns true if item appears in list and returns false otherwise. The list resultList is initially empty. Which of the following best describes the contents of resultList after the code segment is executed?

B - Only elements that appear in both inputList1 and inputList2

Both online newspapers and social media sites are used to distribute information on the Internet. Which of the following best describes an advantage that online newspapers have over social media sites?

B - The ability to provide credibility to the information distributed

A certain computer game is played between a human player and a computer-controlled player. Every time the computer-controlled player has a turn, the game runs slowly because the computer evaluates all potential moves and selects the best one. Which of the following best describes the possibility of improving the running speed of the game?

B - The game's running speed might be improved by using a process that finds approximate solutions every time the computer-controlled player has a turn.

A cable television company stores information about movie purchases made by subscribers. Each day, the following information is summarized and stored in a publicly available database. The day and date each movie was purchased The title of each movie purchased The cities where subscribers purchased each movie The number of times each movie was purchased by subscribers in a given city A sample portion of the database is shown below. The database is sorted by date and movie title. Which of the following CANNOT be determined using only the information in the database?

B - The number of movies purchased by an individual subscriber for a particular month

A certain social media Web site allows users to post messages and to comment on other messages that have been posted. When a user posts a message, the message itself is considered data. In addition to the data, the site stores the following metadata. The time the message was posted The name of the user who posted the message The names of any users who comment on the message and the times the comments were made For which of the following goals would it be more useful to analyze the data instead of the metadata?

B - To determine the time of day that the site is most active

Central High School keeps a database of information about each student, including the numeric variables numberOfAbsences and gradePointAverage. The expression below is used to determine whether a student is eligible to receive an academic award. (numberOfAbsences ≤ 5) AND (gradePointAverage > 3.5) Which of the following pairs of values indicates that a student is eligible to receive an academic award?

B - numberOfAbsences = 5, gradePointAverage = 3.8

The figure below shows a robot in a grid of squares. The robot is represented as a triangle, which is initially facing upward. The robot can move into a white or gray square but cannot move into a black region. Consider the procedure MoveAndTurn below. Which of the following code segments will move the robot to the gray square?

C

Consider the following code segment, which uses the variables r, s, and t. r ← 1 s ← 2 t ← 3 r ← s s ← t DISPLAY (r) DISPLAY (s) What is displayed as a result of running the code segment?

C - 2 3

An online store uses 6-bit binary sequences to identify each unique item for sale. The store plans to increase the number of items it sells and is considering using 7-bit binary sequences. Which of the following best describes the result of using 7-bit sequences instead of 6-bit sequences?

C - 2 times as many items can be uniquely identified

A video-streaming Web site uses 32-bit integers to count the number of times each video has been played. In anticipation of some videos being played more times than can be represented with 32 bits, the Web site is planning to change to 64-bit integers for the counter. Which of the following best describes the result of using 64-bit integers instead of 32-bit integers?

C - 2^32 times as many values can be represented.

An algorithm will be used to identify the maximum value in a list of one or more integers. Consider the two versions of the algorithm below. Algorithm I : Set the value of a variable max to − 1. Iterate through the list of integer values. If a data value is greater than the value of the variable max, set max to the data value. Algorithm II : Set the value of a variable max to the first data value. Iterate through the remaining values in the list of integers. If a data value is greater than the value of the variable max, set max to the data value. Which of the following statements best describes the behavior of the two algorithms?

C - Algorithm II always works correctly, but Algorithm I only works correctly when the maximum value is greater than or equal to − 1.

There are 32 students standing in a classroom. Two different algorithms are given for finding the average height of the students. Algorithm A Step 1: All students stand. Step 2: A randomly selected student writes his or her height on a card and is seated. Step 3: A randomly selected standing student adds his or her height to the value on the card, records the new value on the card, and is seated. The previous value on the card is erased. Step 4: Repeat step 3 until no students remain standing. Step 5: The sum on the card is divided by 32. The result is given to the teacher. Algorithm B Step 1: All students stand. Step 2: Each student is given a card. Each student writes his or her height on the card. Step 3: Standing students form random pairs at the same time. Each pair adds the numbers written on their cards and writes the result on one student's card; the other student is seated. The previous value on the card is erased. Step 4: Repeat step 3 until one student remains standing. Step 5: The sum on the last student's card is divided by 32. The result is given to the teacher. Which of the following statements is true?

C - Both Algorithm A and Algorithm B always calculate the correct average.

Programs I and II below are each intended to calculate the sum of the integers from 1 to n. Assume that n is a positive integer (e.g., 1, 2, 3, ...). Which of the following best describes the behavior of the two programs?

C - Both program I and program II display the correct sum.

Biologists often attach tracking collars to wild animals. For each animal, the following geolocation data is collected at frequent intervals. The time The date The location of the animal Which of the following questions about a particular animal could NOT be answered using only the data collected from the tracking collars?

C - Do the movement patterns of the animal vary according to the weather?

The procedure below is intended to display the index in a list of unique names (nameList) where a particular name (targetName) is found. If targetName is not found in nameList, the code should display 0. Which of the following procedure calls can be used to demonstrate that the procedure does NOT work as intended?

C - FindName (["Andrea", "Ben", "Chris"], "Ben")

A programmer completes the user manual for a video game she has developed and realizes she has reversed the roles of goats and sheep throughout the text. Consider the programmer's goal of changing all occurrences of "goats" to "sheep" and all occurrences of "sheep" to "goats." The programmer will use the fact that the word "foxes" does not appear anywhere in the original text. Which of the following algorithms can be used to accomplish the programmer's goal?

C - First, change all occurrences of "goats" to "foxes." Then, change all occurrences of "sheep" to "goats." Last, change all occurrences of "foxes" to "sheep."

An author is considering publishing an e-book using a Creative Commons license. In which of the following situations would it be better for the author to use a Creative Commons license instead of a traditional copyright? The author wants to make the e-book available as a free download. The author wants to prevent people from sharing copies of the e-book on peer-to-peer networks. The author wants to allow people permission to use and modify the e-book.

C - I & III

ASCII is a character-encoding scheme that uses 7 bits to represent each character. The decimal (base 10) values 65 through 90 represent the capital letters A through Z, as shown in the table below. What ASCII character is represented by the binary (base 2) number 1001010 ?

C - J

In the program below, the initial value of x is 5 and the initial value of y is 10. What is displayed as a result of running the program?

C - November

A city government is attempting to reduce the digital divide between groups with differing access to computing and the Internet. Which of the following activities is LEAST likely to be effective in this purpose?

C - Putting all government forms on the city web site

An algorithm has been developed to compute the sum of all the elements in a list of integers. Which of the following programming structures must be added to the existing algorithm so that the new algorithm computes the sum of only the even integers in the list?

C - Selection

A programmer wrote the program below. The program uses a list of numbers called numList. The program is intended to display the sum of the numbers in the list. In order to test the program, the programmer initializes numList to [0, 1, 4, 5]. The program displays 10, and the programmer concludes that the program works as intended. Which of the following is true?

C - The conclusion is incorrect; using the test case [0, 1, 4, 5] is not sufficient to conclude the program is correct.

In the procedure Mystery below, the parameter number is a positive integer. Which of the following best describes the result of running the procedure Mystery?

C - The procedure returns true when the initial value of number is even, and it otherwise returns false.

ASCII is a character-encoding scheme that uses a numeric value to represent each character. For example, the uppercase letter "G" is represented by the decimal (base 10) value 71. A partial list of characters and their corresponding ASCII values are shown in the table below. ASCII characters can also be represented by hexadecimal numbers. According to ASCII character encoding, which of the following letters is represented by the hexadecimal (base 16) number 56?

C - V

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

D

The code fragment below is intended to display "odd" if the positive number num is odd. Which of the following can be used to replace <MISSING CONDITION> so that the code fragment will work as intended?

D - (num MOD 2) = 1

A car manufacturer uses simulation software during the design process for a new car. Which of the following are reasons to use simulation software in this context? -Using simulation software can save the company money by helping to compare designs early in the process, before prototype cars are built. -Using simulation software can help to identify safety issues by providing data about how different mechanical components will interact in a wide variety of situations. -The manufacturer can present simulation software to customers to demonstrate different design possibilities.

D - I , II , and III

A programmer wrote the code segment below to display the average of all the elements in a list called numbers. There is always at least one number in the list. The programmer wants to reduce the number of operations that are performed when the program is run. Which change will result in a correct program with a reduced number of operations performed?

D - Interchanging line 7 and line 8

Consider the following program code. Which of the following best describes the result of running the program code?

D - Nothing is displayed; the program results in an infinite loop.

The table below shows the time a computer system takes to complete a specified task on the customer data of different-sized companies. Based on the information in the table, which of the following tasks is likely to take the longest amount of time when scaled up for a very large company of approximately 100,000 customers?

D - Sorting Data

A new bank plans to make customer convenience a priority by minimizing the amount of time a customer waits in line. The bank is considering two options: a single line where the customer at the front waits for the next available teller, or separate lines for each teller. The bank decides to use a computer simulation of these two options to determine the average wait time for customers. Which of the following is NOT true about the bank's plan?

D - The simulation will not produce usable results because actual customer data are not available.

An Internet service provider (ISP) is considering an update to its servers that would save copies of the Web pages most frequently visited by each user. Which of the following is LEAST likely to occur as a result of the update?

D - Web sites that are not visited frequently might no longer be accessible to users.

The algorithm below is used to simulate the results of flipping a coin 4 times. Consider the goal of determining whether the simulation resulted in an equal number of heads and tails. Step 1: Initialize the variables heads_counter and flip_counter to 0. Step 2: A variable coin_flip is randomly assigned a value of either 0 or 1. If coin_flip has the value 0, the coin flip result is heads, so heads_counter is incremented by 1. Step 3: Increment the value of flip_counter by 1. Step 4: Repeat steps 2 and 3 until flip_counter equals 4. Following execution of the algorithm, which of the following expressions indicates that the simulation resulted in an equal number of heads and tails?

D - head_counter = 2

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

idk


Kaugnay na mga set ng pag-aaral

Hour of the Bees by Lindsay Eagar

View Set

Vocab Level H Unit 8 Completing the Sentence

View Set

AP Physics Semester 1: Conceptual Questions

View Set

Project Management Quiz 7 Review

View Set

ISTQB Foundation - Practice Exam 1

View Set