Skip to the content.

Practice MCQ Reflection

MCQ Reflection

A. One thing I learned from this quiz is how to think critically and understand code that is presented to me. I also learned about different concepts in computer science and how they are applied to problem solving. Finally, I learned a lot of theoretical knowledge such as abstraction, pseudocode, and the internet, which has practical applications in technology and computer science.

B. I feel weaker on questions involving theoretical knowledge of computer science. Specifically, I had some trouble on questions relating to the internet because I had not learned about those concepts before. To improve my skills on these questions, I can learn and study more about theoretical knowledge of computer science.

C. Corrections:

Question:

The code segment below is intended to swap the values of the variables first and second using a temporary variable, temp.

The block code consists of 3 lines. Line 1: temp, left arrow, first Line 2: first, left arrow, second Line 3: MISSING CODE

Which of the following can be used to replace missing code so that the code segment works as intended?

My Response: D Correct Answer: B Explanation: The code segment never changes the value of second.

Question:

Which of the following actions could be used to help reduce the digital divide?

I.   Providing free education and training on how to use computing devices
II.  Providing free or low-cost computing devices to low-income individuals
III. Providing networks and infrastructure to people in remote area

My response: C Correct Answer: D Explanation: Free education and training would address digital literacy and would reduce the digital divide.

Question:

The grid below contains a robot represented as a triangle, initially facing up. The robot can move into a white or gray square but cannot move into a black region.

The code segment below uses the procedure One word, Goal Reached, which evaluates to true if the robot is in the gray square and evaluates to falseotherwise.

REPEAT UNTIL (GoalReached ())
{
    <MISSING CODE>
}

Which of the following replacements for <missing code> can be used to move the robot to the gray square?

My response: C Correct Answer: A Explanation: This code segment moves the robot up and down between its initial location and the square above its initial location.

Question:

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the bottom right square of the grid and facing toward the top of the grid.

The following programs are each intended to move the robot to the gray square. Program II uses the procedure One word, Goal Reached, which returns true if the robot is in the gray square and returns false otherwise.

Which of the following statements is true?

My response: B Correct Answer: C Explanation: Program I also correctly moves the robot to the gray square by repeatedly moving the robot forward, rotating left, moving forward, and rotating right.

Question:

The two code segments below are each intended to display the average of the numbers in the list One word, num List. Assume that One word, num List contains more than one value.

Which of the following best describes the two code segments?

My response: B Correct Answer: C Explanation: Code segment I also displays the correct average.

Question:

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 ?

My response: B Correct Answer: A Explanation: The number of steps of the algorithm is a polynomial, so the algorithm runs in reasonable time.

Question:

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 plus 8 will result in an overflow error.
II. The operation 7 plus 10 will result in an overflow error.
III. The operation 12 plus 3 will result in an overflow error.

My response: D Correct Answer: B Explanation: The operation 10 plus 7 causes an overflow error, but the operations 4 plus 8 and 12 plus 3 do not produce results large enough to cause an overflow error.

Question:

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.

My response: B & D Correct Answer: B & A Explanation: It is possible to determine the average number of days students are absent. Both data formats provide the number of absences for each student.

Question:

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 One word, is Prime, open parenthesis, n, close parenthesis, 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.

My response: A & B Correct Answer: B & D Explanation: The variable count should be set to 0 before the loop so that it starts counting at 1.

Question:

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 One word, the List will Smallest, open parenthesis, one word, the List, close parenthesis NOT return the intended value?

Select two answers.

My response: B & C Correct Answer: C & D Explanation: For the list [20, 10, 30, 40] close bracket, 1 0 is the first value smaller than the first number in the list, so the procedure returns the correct value 10

D. Reviewing my answers that I got wrong and right will help me in the future. I will be more prepared and more likely to get them right.