CSP Feb. 1st CB Questions
A school library allows students to borrow laptops. A computer program is used to count the number of times a particular laptop has been borrowed from the library and the number of times the same laptop has been returned to the library . Which of the following indicate that a particular laptop is not currently borrowed? Select two answers. A The difference between and is zero. B The product of and is a positive even number. C The quotient when is divided by is greater than 1. D The sum of and is a positive even number.
A and C
Each student that enrolls at a school is assigned a unique ID number, which is stored as a binary number. The ID numbers increase sequentially by 1 with each newly enrolled student. If the ID number assigned to the last student who enrolled was the binary number 1001 0011, what binary number will be assigned to the next student who enrolls? A 1001 0100 B 1001 0111 C 1101 0100 D 1101 0111
A. 1001 0100
The variable isOpen is to be used to indicate whether or not a store is currently open. Which of the following is the most appropriate data type for isOpen ? A Boolean B number C string D list
A. Boolean
Which of the following activities is most likely to be successful as a citizen science project? A Collecting pictures of plants from around the world that can be analyzed to look for regional differences in plant growth. B Designing and building a robot to help with tasks in a medical laboratory. C Sorting scientific records and removing duplicate entries in a database with a large number of entries. D Using a simulation to predict the impact of a construction project on local animal populations.
A. Collecting pictures of plants from around the world that can be analyzed to look for regional differences in plant growth
Which of the following are benefits of using well-named variables in a computer program? Select two answers. A The program will run faster. B The program will be easier for people to read. C The program will have a greater data storage capacity. D The program will be easier to modify in the future.
B and D
A programmer has a need to round many numeric values to the nearest integer. Which of the following best explains the benefit of using a list as a data abstraction in this situation? A Keeping the numeric values in a list makes it easier to round a number to the nearest integer. B Keeping the numeric values in a list makes it easier to apply the same computation to every data element. C Keeping the numeric values in a list makes it easier to prevent a program from unintentionally changing the value of a variable. D Keeping the numeric values in a list makes it easier to prevent a program from attempting to access an index beyond the length of the list.
B. Keeping the numeric values in a list makes it easier to apply the same computation to every data element
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? A 1 1 B 1 2 C 2 3 D 3 2
C. 2 3
Which of the following initial values of the variable y would result in the variable z being set to 2 after the code segment is executed? A 1 B 2 C 3 D 4
C. 3
Consider the 4-bit binary numbers 0011, 0110, and 1111. Which of the following decimal values is NOT equal to one of these binary numbers? A. 3 B. 6 C. 9 D. 15
C. 9
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? A. A B. L C. V D. Y
C. V
Consider the following code segment. x ←← 25 y ←← 50 z ←← 75 x ←← y y ←← z z ←← x Which of the variables have the value 50 after executing the code segment? A x only B y only C x and z only D x, y, and z
C. x and z only
A teacher has a goal of displaying the names of 2 students selected at random from a group of 30 students in a classroom. Any possible pair of students should be equally likely to be selected. Which of the following algorithms can be used to accomplish the teacher's goal? A Step 1:Assign each student a unique integer from 1 to 30.Step 2:Generate a random integer n from 1 to 15.Step 3:Select the student who is currently assigned integer n and display the student's name.Step 4:Generate a new random integer n from 16 to 30.Step 5:Select the student who is currently assigned integer n and display the student's name. B Step 1:Assign each student a unique integer from 1 to 30.Step 2:Generate a random integer n from 1 to 30.Step 3:Select the student who is currently assigned integer n and display the student's name.Step 4:Generate a new random integer n from 1 to 30.Step 5:Select the student who is currently assigned integer n and display the student's name. C Step 1:Assign each student a unique integer from 1 to 30.Step 2:Generate a random odd integer n from 1 to 29.Step 3:Select the student who is currently assigned integer n and display the student's name.Step 4:Generate a new random even integer n from 2 to 30.Step 5:Select the student who is currently assigned integer n and display the student's name. D Step 1:Assign each student a unique integer from 1 to 30.Step 2:Generate a random integer n from 1 to 30.Step 3:Select the student who is currently assigned integer n and display the student's name.Step 4:The student who was selected in the previous step is assigned 0. All other students are reassigned a unique integer from 1 to 29.Step 5:Generate a new random integer n from 1 to 29. Step 6:Select the student who is currently assigned integer n and display the student's name.
D.
The position of a runner in a race is a type of analog data. The runner's position is tracked using sensors. Which of the following best describes how the position of the runner is represented digitally? A The position of the runner is determined by calculating the time difference between the start and the end of the race and making an estimation based on the runner's average speed. B The position of the runner is measured and rounded to either 0 or 1 depending on whether the runner is closer to the starting line or closer to the finish line. C The position of the runner is predicted using a model based on performance data captured from previous races. D The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.
D. The position of the runner is sampled at regular intervals to approximate the real-world position, and a sequence of bits is used to represent each sample