Computer Science 1

¡Supera tus tareas y exámenes ahora con Quizwiz!

6. Moore's Law describes the rate at which the number of transistors on a single chip doubles over time. Which of the following assumptions CANNOT be inferred as a direct consequence of this rate of doubling? (A) Five years from now, computer programs will be able to solve complex problems faster than today's computer programs. (B) Five years from now, web pages will require less memory (RAM) than today's web pages. (C) Five years from now, top-of-the-line computers will have faster processors (CPUs) than today's top-of-the-line computers. (D) Five years from now, electronic components can be made smaller than today's equivalent electronic components.

B

A programmer is attempting to convince her boss to give her time to write a program which will improve efficiency in the office by determining when and where certain resources should be allocated. Which of the following would be most useful for her to show to her boss to help him understand how the program will work? (A) A printout of all of the code she has created for the program so far. (B) Examples of various inputs and the intended outputs of the code resulting from these. (C) A list of errors which were encountered when she attempted to compile the code. (D) A list of pros and cons of using different programming languages to create the program.

B

Consider the block of code below: What would be the most appropriate substitute for the missing Boolean Operator if the intention is to display "True" for only values of x between, but not equal to values of 0 and 10? (A) NOT (B) AND (C) OR (D) XOR

B

Given the following code segment, what would be displayed if age were initialized with a value of 18? (A) group 1 (B) group 2 (C) group 1 group 2 (D) Nothing will be displayed

B

If the variables onTime and absent both have the value false, what is displayed as a result of running the code segment? (A) Is anyone there? (B) Better late than never. (C) Hello. Is anyone there? (D) Hello. Better late than never.

B

Jasper is attempting to create instructions for folding clothes which could be described as an algorithm. Which of the following would be a feature of Jasper's instructions if they could be considered to describe an algorithm? (A) The instructions would be completely random. (B) The instructions would involve logical decisions and specific ordered sets of actions. (C) The instructions would result in exactly the same actions being performed for every item of clothing. (D) The instructions would be written in a high-level programming language.

B

The volume of a rectangular prism is calculated by multiplying its length (l), width (w) and height (h). What could be substituted into the section of the code below marked < missing code > that would accurately calculate the volume based on the user input of l, w and h? (A) l x w x h (B) l * w * h (C) l(w)(h) (D) l / w / h

B

What is displayed if the elevator is currently on the 7 th floor (level = 7) and the person on the elevator presses a button labeled "up 3 floors" which causes the variable floors to be set to 3. What will be displayed when the code above runs? (A) Level 7 Level 8 Level 9 (B) Level 8 Level 9 Cannot go up. Level 9 (C) Level 8 Level 9 Level 10 (D) Cannot go up.

B

What is displayed if the user enters "16" and then "coffee" when the program runs? (A) Bottle of soda (B) Can of soda (C) Grande coffee (D) Short coffee

B

When Jenna runs the code it does not perform as intended and many of the drums play simultaneously. Which of the following changes could Jenna make to ensure the code works as intended? (A) Remove the block (B) Move the block from its current location to below the block (C) Replace the block with (D) None of the above options

B

Which of the following algorithms will successfully cause the robot to trace out a cross path as drawn above? (A) Step 1: MOVE_FORWARD Step 2: ROTATE_LEFT Step 3: MOVE_FORWARD Step 4: ROTATE_RIGHT Step 5: MOVE_FORWARD Step 6: ROTATE_RIGHT Step 7: ROTATE_RIGHT Step 8: MOVE_FORWARD (B)Step 1: MOVE_FORWARD Step 2: MOVE_FORWARD Step 3: ROTATE_LEFT Step 4: ROTATE_LEFT Step 5: MOVE_FORWARD Step 6: ROTATE_RIGHT Step 7: MOVE_FORWARD Step 8: ROTATE_RIGHT Step 9: ROTATE_RIGHT Step 10: MOVE_FORWARD Step 11: MOVE_FORWARD (C)Step 1: MOVE_FORWARD Step 2: ROTATE_LEFT Step 3: MOVE_FORWARD Step 4: ROTATE_LEFT Step 5: ROTATE_LEFT Step 6: MOVE_FORWARD Step 7: MOVE_FORWARD Step 8: ROTATE_RIGHT Step 9: ROTATE_RIGHT Step 10: MOVE_FORWARD Step 11: ROTATE_LEFT Step 12: MOVE_FORWARD (D)Step 1: MOVE_FORWARD Step 2: ROTATE_RIGHT Step 3: MOVE_FORWARD Step 4: ROTATE_LEFT Step 5: ROTATE_LEFT Step 6: MOVE_FORWARD Step 7: ROTATE_RIGHT Step 8: MOVE_FORWARD Step 9: ROTATE_LEFT Step 10: ROTATE_LEFT Step 11: MOVE_FORWARD

B

Which of the following features of a scratch program could not be changed by a block at a later stage of the program? (A) The background image (B) The name of a sprite (C) The value of a variable (D) The visibility of a sprite

B

Which of the following languages is easily understandable, but is likely to contain many ambiguities? (A) Machine Code (B) Natural Language (C) High-level programming language (D) Low-level programming language

B

A financial analyst wishes to predict the chances of a fall of 10% or more in a particular stock in the next week by analyzing the recent performance of the stock. Which of the following sources of data would be the most appropriate for helping him make the prediction? (A) A list of floating-point values representing the changes in the value of the stock over the past 10 weeks. (B) An integer representing the number of times the stock has previously fallen by 10% or more in a week. (C) A list of integers representing the days of the previous week on which the value of the stock fell. (D) A floating point value representing the change in the value of the stock in the same week of the previous year.

A

Based on the intended purpose of the code, which of the following blocks would be most appropriate as the missing condition? (A) (B) (C) (D)

A

Which of the following CollegeBoard AP Computer Science Principles Pseudocode commands is used to record something typed by a user of the program so that it can be used in the program? (A) INPUT () (B) DISPLAY (expression) (C) a MOD b (D) RANDOM (a, b)

A

Which of the following best describes the conditions which must be satisfied by the user-inputted values of x and y if the program is to display Right Right when run? (A) x must be 0 and y must be a positive number (B) x cannot be 0 and y must be a negative number (C) x and y must both be equal to 0 (D) No values of x and y will display Right Right

A

Which of the following best describes the meaning of the term "source code" in the context of a programmer writing a program? (A) The code written by the programmer, usually in a high-level language, to be compiled by the compiler. (B) A low-level language which the compiled code can be written in and closely corresponds to the ones and zeroes understood by the computer. (C) The ones and zeroes which are actually understood and run by the computer. (D) A generic language which can be used to express the functioning of the program without needing to use the specific syntax of any particular programming language.

A

Which of the following could be represented by a boolean variable? (A) Whether a pair of headphones is plugged into a specific port (B) The name of an item on a menu (C) Whether a number is positive, negative or zero. (D) The number of appointments a dentist has in a given week.

A

Which of the following shows the location of the robot after running the code segment? (A) (B) (C) (D)

A

20. Which of the following are advantages of using meaningful names for variables when writing a program? Select two answers. (A) It is easier for a person reading the code to identify the purpose of a variable and follow the logic of the program. (B) It is simpler for the compiler to compile the program, meaning wait times and errors are reduced. (C) The programmer is less likely to make a mistake and use a variable for the wrong purpose. (D) Less variables will be required as the existing ones can be renamed throughout the program.

A,C

Which of the following gives the best ways in which this could be beneficial to Sally when she debugs and reasons through her program? Select two answers. (A) The procedure can make the code section more abstract, so she doesn't have to think through all 10 blocks each time she comes across them in her code. (B) The procedure will make the program more efficient, spending less time running the same set of 10 blocks over and over again. (C) If there is an error in the procedure, she can fix the error in the procedure without having to search through her code for each place the procedure is used. (D) She will be able to hide the function of this code block easier meaning others cannot copy her work.

A,C

Which of the following algorithms require both selection and iteration? Select two answers: (A) An algorithm that, given two integers, displays the greater of the two integers. (B) An algorithm that, given a list of integers, displays the number of even integers in the list. (C) An algorithm that, given a list of integers, displays only the negative integers in the list. (D) An algorithm that, given a list of integers, displays the sum of the integers in the list.

B,C

Which two of the following values are more likely to be displayed than the other two values listed when this block of code is run? Select two answers. (A) 5 (B) 12 (C) 14 (D) 20

B,C

. Nick wishes to create a variable in his scratch game which records the best score by a player so far. Which of the following would be the most appropriate name for this variable? (A) Variable1 (B) b (C) best_score (D) theBestScoreSoFarByAPlayer

C

4. Hiro is writing a program which will record the number of cars passing a certain point in town every hour in a day, then record the range of this data by subtracting the smallest total from the largest. He will use a variable, rge, to store the range. Which variable type would be most suitable for rge? (A) Floating point (float) (B) Boolean (C) Integer (int) (D) String

C

Three friends are programming a game together and have run into problems working on the code simultaneously. It is difficult for each programmer to test the code when needed as other parts of the code are often not ready, and it is not always clear whose code is causing errors. Which of the following solutions should the programmers implement to solve these problems. (A) Leave all testing of the code until everything is complete and then thoroughly test the completed program. (B) Only allow one person to program at a time. (C) Create individual copies of the code for each programmer to work on and test different sections, then add code to a master copy as it is completed. (D) Make each programmer write their own complete version of the game, then use the best solutions from each programmer to create a joint program.

C

Unfortunately at the end of the routine, Mira's sprite is upside down, which she does not want. Which of the following changes would fix this problem and ensure the sprite finishes the dance the right way up? (A) Removing the block. (B) Removing the block. (C) Removing the block. (D) Removing the and blocks.

C

What is the maximum possible value of answer after running the program? (A) 2 (B) 10 (C) 20 (D) 40

C

Which of the following statements about low and high-level programming languages is not true? (A) High-level languages make more use of abstractions than low-level languages. (B) High-level languages are generally easier for humans to read and understand than low-level languages. (C) High-level languages are closer in structure to the binary code understood by computers than low-level languages (D) High-level languages are more likely to contain ambiguities than low-level languages.

C

Which of the following statements comparing block-based and text-based programming languages is true? (A) Block-based languages offer far greater control over low-level functionality than text-based languages. (B) Most programs written in a block-based language could not be replicated in a text-based language. (C) Errors from incorrect syntax are far more likely if writing using a text-based language than if using a block-based language. (D) Text-based languages are far more likely to be ambiguous than block-based languages.

C

Which of the following would not be considered an example of abstraction? (A) A football coach uses a named "play" to refer to a complex set of actions performed by players on her team. (B) A programmer stores a long message using a String variable called message1. Whenever the long message needs to be accessed, it is referred to in the code by message1. (C) A programmer renames all the variables in their program to make it shorter. (D) A robot can be programmed with the command MOVE_FORWARD, which causes a motor and several sensors to perform a series of tasks to move the robot a fixed distance forward.

C

Which of the following Scratch blocks would result in the variable number being increased by 2? Select two answers. (A) (B) (C) (D)

C,D

1. Which of the following would not be a sensible action to take before beginning to write a program? (A) Decide how to name the variables in the program so their purpose is clear and no conflicts or confusion arises between variables. (B) Consider the outputs which might be expected by the program given a variety of different inputs. (C) Draw or write a brief outline of the logical steps will need to be written in the program in order to ensure it behaves as intended. (D) Choose a random segment of the program to write in full in order to get a feel for what will be required.

D

10. A particular problem is currently not able to be practically solved by using an algorithm. Which of the following statements about the problem could possibly be true? I. No algorithm has yet been developed which would solve this problem, but it is possible one may be developed in the future. II. An algorithm has been developed which would solve this problem but technology is not yet available which would compute this algorithm fast enough to be practicable. III. It is impossible to develop an algorithm which would solve this problem. (A) I only (B) I and II only (C) I and III only (D) I, II, and III

D

The blocks below are used to create code which will run at the start of a game created in Scratch. In which order should the blocks be placed so that the code runs at the start of the game with no errors, and produces a meaningful introduction to the game?(A) 2-5-4-3-1 (B) 2-4-5-1-3 (C) 3-5-1-2-4 (D) 2-4-3-5-1

D

What values, when inputted by the user, of A, B, and C will cause the code to display "Invalid Input"? (A) A = -10 B = 0 C = 4 (B) A = 0 B = 0 C = 0 (C) A = -1 B = -2 C = 0 (D) A = -5 B = 0 C = 0

D

What would be the final value of the variable third once the following program is complete? first ← 2 second ← 3 third ← first * second second ← third - first first ← first + second + third third ← second * first (A) 6 (B) 33 (C) 36 (D) 48

D

Which of the following best describes the likely results of this test? (A) The linear search will now be faster on average than the binary search. (B) The binary search will still be faster on average than the linear search, and the difference in run times between the two searches will be approximately the same as for the shorter lists. (C) The binary search will still be faster on average than the linear search, and the difference in run times between the two searches will be approximately 10 times greater than for the shorter lists. (D) The binary search will still be faster on average than the linear search, and the difference in run times between the two searches will be significantly more than 10 times greater than for the shorter lists.

D

Which of the following best describes the result of running the code segment? (A) The number 0 is displayed. (B) The number 4 is displayed. (C) The number 10 is displayed. (D) Nothing is displayed; the program results in an infinite loop.

D


Conjuntos de estudio relacionados

Oceans CH 6 - The Atmosphere and The Oceans

View Set

Unit 4 Review: Triumph of Industry; Labor Movement; Cities, Immigration and Farmers

View Set

John- 3-Cambridge Use of English

View Set

BMGT332 Final Exam Multiple Choice

View Set

Schizophrenia Spectrum and other psychoses (connect quiz)

View Set

verbs, nouns, adjectives + prepositions P1.14

View Set