1.1-1.9 AP-Style MC Practice & Quizzes

Ace your homework & exams now with Quizwiz!

Understanding of the life cycle of a program is an essential component to becoming an effective programmer. Which of the following is the best example of how the life cycle of a program should work? a) Idea→algorithm→write code→execute code→debug→maintain b) Idea→algorithm→write code→debug→execute code→maintain c) Idea→write code→algorithm→execute code→debug→maintain d) Idea→algorithm→write code→execute code→maintain→debug

a) Idea→algorithm→write code→execute code→debug→maintain -This is correct. Every program begins with an idea: something which the programmer would like to achieve using this program. Before writing code the programmer should consider the logical and mathematical steps that the program would need to take to achieve this goal: this describes an algorithm. Then this algorithm can be implemented by writing it using code. Once created the code can be executed (run) and the results observed. If these results are not as expected (i.e. the program does no do what it was supposed to do) the programmer will need to debug this code to remove any errors. Once the code has been debugged it can be released, however a good programmer will maintain their code, ensuring it meets the latest standards for compatibility and removing any user reported bugs that might occur.

Which of the following is a simplified but equivalent Boolean expression to the following:(X > 0 AND X ≤ 20) OR (X > -5 AND X < 15) a)(X > -5) AND (X ≤ 20) b)(X < 0) AND (X > 15) c)(X > 0) AND (X < 15) d)(X < -5) AND (X ≥ 20)

a)(X > -5) AND (X ≤ 20)

Consider the following code segment, which is attached to a sprite in a Scratch program: -when flag clicked -ask (What's the first number) and wait -set (num) to (answer) -ask (What's the second number) and wait -set (num) to (answer) -say ((num) + (answer)) for (2) seconds Suppose this Scratch program is run, and the user types 3 in response to the first question, and 5 in response to the second question. What number does the sprite say at the end of this script? a)10 b)No answer text provided c)6 d)8

a)10 -This is correct. The first user input of 3 is stored as answer, and the value of num is then set to the same value as answer, so this is also 3. The second user input of 5 is then stored as answer, replacing the old value of 3, and once again num is changed to the same value as answer, 5. The sprite then says the sum of num and answer, and as both of these are equal to 5, this is 5 + 5 = 10.

Consider the following actions which might be performed by a developer when creating a new piece of software to solve a problem. 1. Thoroughly testing code with a variety of inputs 2. Designing an algorithm to tackle the central problem the program hopes to solve 3. Considering what outputs a program solving the problem might produce and what inputs it may require to do this 4. Writing code in a high-level programming language to implement an algorithm In which order in the development cycle would these actions first appear? a)3, 2, 4, 1 b)2, 3, 4, 1 c)2, 4, 1, 3 d)3, 4, 1, 2

a)3, 2, 4, 1

Which of the following best describes how abstraction makes code written in higher-level programming languages easier for humans to parse? a)Abstractions used in higher-level languages mean what a command does is easier to understand without needing to parse all the individual operations performed by the CPU. b)Abstractions used in higher-level languages make them almost identical to a natural language which would be spoken by humans. c)Abstractions used in higher-level languages remove any potential ambiguity from the code. d)Abstractions used in higher-level languages make the code closer to the actual individual operations performed by the CPU

a)Abstractions used in higher-level languages mean what a command does is easier to understand without needing to parse all the individual operations performed by the CPU.

Which of the following statements are NOT true about high level programming languages? Select two answers: a)Code written using high level languages is guaranteed to be ambiguous b)Any particular algorithm will be written in the same way regardless of which high level programming language is used c)Code written using high level languages usually requires compiling before it can be run d)Code written using high level languages is relatively easy for humans to read, write and parse

a)Code written using high level languages is guaranteed to be ambiguous b)Any particular algorithm will be written in the same way regardless of which high level programming language is used

Which of the following describes algorithmic solutions to problems: I. A set of step by step instructions for assembling a piece of furniture. II. A flowchart used to make important decisions on which actions to take in an emergency situation III. A recipe for baking a cake with detailed numbered steps to follow a)I, II and III b)II and III only c)I and III only d)I and II only

a)I, II and III

Consider the following two implementations of the same algorithm, each written in a different language. Language A: Calculate the average daily rainfall for the week (averageRainfall) by adding together the rainfall totals for each of the 7 days of the week (sun, mon, tue, wed, thu, fri, and sat) and dividing the sum by 7. Language B: Take the total amount of rain from each day of the week (sunday, monday, tuesday, wednesday, thursday, friday and saturday) and then average them together to get the average daily rainfall for the week (averageRainfall). Which of the following statements about these two implementations is true? a)Language B is ambiguous because the process of "average" is not explained well. b)The algorithms in both languages are ambiguous because they do not specify the actual values of the seven daily rainfall totals. c)Neither of these languages is clear enough that a programmer could write a correct solution in a high-level programming language. d)Language A is ambiguous because it is unclear what sun, mon, tue, wed, thu, fri, and sat refer to in context with the problem.

a)Language B is ambiguous because the process of "average" is not explained well. -This is correct. The terminology "average them together" is quite ambiguous, especially since more than one type of "average" exists. This might make it difficult for a programmer to write code that gives the result desired by the person writing this statement.

The owner of a pet store wants to determine how many fish she can keep in a given aquarium before the population becomes too overcrowded for the fish to survive. Rather than risking the lives of actual fish, she decides to simulate an aquarium with a program in order to determine its maximum capacity. Which of the following would NOT be a useful factor to include when modeling the properties of the simulated tank and fish population? a)The color of the fish b)The size of the fish c)The amount of food in the tank d)The size of the tank

a)The color of the fish

The following algorithm is proposed for the task of baking a cake, and is presented along with a list of ingredients. -Add some ingredients from the list to a bowl -Stir -Add other ingredients to a bowl -Stir -Put in a tin in the oven -Take out tin from oven Which of the following correctly describes an issue with the way the instructions in this algorithm is presented? a)The instructions lack imperative statements b)The instructions do not contain any selection or iteration statements c)The sequencing of the instructions is unclear d)The instructions lack descriptive qualifiers

a)The instructions lack descriptive qualifiers

Marta is writing a program for a home-automation system. Three of the variables in her program are as follows: light - A variable which determines whether the lights in a room are switched on or off temp - A variable which records the temperature of the room to the nearest whole degree Fahrenheit name - A variable which records the name the user has set for the room (e.g. "kitchen") Which of the following correctly describes the types which would be best used for each of these variables? a)light - boolean, temp - integer, name - string b)light - integer, temp - boolean, name - string c)light - string, temp - integer, name - boolean d)light - boolean, temp - string, name - integer

a)light - boolean, temp - integer, name - string

A program that Thomas has written is complete. It has been tested thoroughly, and some outputs were not as expected. Thomas is now going through the code carefully attempting to establish the cause of these errors and change the code to remove them. What is this procedure called? a) Coding b) Debugging c) Development d) Error Check

b) Debugging -This is correct. Errors in code causing the program to behave in incorrect ways (e.g. calculating incorrect values or crashing) are called "bugs". The process of finding these errors and correcting them is known as "debugging".

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 this? a)First, change all occurrences of goats to foxes, then change all occurrences of foxes to sheep, and then change all occurrences of sheep to goats. b)First, change all occurrences of goats to foxes, then change all occurrences of sheep to goats, and then change all occurrences of foxes to sheep. c)First, change all occurrences of goats to sheep, then change all occurrences of sheep to foxes, and then change all occurrences of foxes to goats. d)First, change all occurrences of goats to sheep, and then change all occurrences of sheep to goats.

b) First, change all occurrences of (goats) to (foxes), then change all occurrences of (sheep) to (goats), and then change all occurrences of (foxes) to (sheep).

Which of the following statements comparing low-level programming languages (such as assembly language) and high-level programming languages (such as python or java) are correct? Select two answers. a)A low-level programming language is easier to learn, but some algorithms can only be written using high level programming languages. b)A program written in a low-level language is closer in syntax to the binary code understood by computers than a program written in a high-level language. c)A program written in a high-level language will usually be easier for a person reading the code to understand than one written in a low-level programming language. d)A low-level program can be easily understood and assembled on any hardware, while the use of a compiler means a high-level program is difficult to use on different systems.

b)A program written in a low-level language is closer in syntax to the binary code understood by computers than a program written in a high-level language. c)A program written in a high-level language will usually be easier for a person reading the code to understand than one written in a low-level programming language.

Rhys is creating a program which stores customer records. One variable used in the program stores the first initial of a customer's name. Which of the following data-types could be used to store this data? Select two answers. a)String b)Character c)Boolean d)Integer

b)Character a)String

Greg is designing a Scratch game in which the player moves a sprite by pressing the arrow keys. Greg writes the following scripts for the sprite: Chelsea suggests that Greg replace these scripts with the following: Which of the following describe advantages of Chelsea's suggestion over Greg's original script? I. If Greg wants to change the default speed the sprite moves at he only needs to edit one block rather than 4 II. It is easy for Greg to add functionality to the program to change the speed of the sprite based on the gameplay (e.g. slowing the sprite's speed when injured) III. It is clearer what the number used in the four movement scripts describes in the game. a)III only b)I, II and III c)I only d)I and II only

b)I, II and III -This is correct. By replacing the number with the variable speed, it is clear that this number relates to how fast the sprite moves across the screen when the key is pressed. By changing the block , Greg can change the default speed. To do that with his original script he would need to change all four blocks. To change the speed based on an action in the program he can add a block to set or change the speed variable to another script, and it will increase the speed of the sprite. He could not do this without making changes if he were to use his original script.

The following algorithm is presented for assembling a piece of furniture from 12 individually numbered parts. Parts 1, 5, and 11 Parts 2 and 10 Part 12 Parts 6 to 9 inclusive Parts 3 and 4 Which of the following correctly describe issues with the way these instructions are presented? I. There instructions lack the required descriptive qualifiers II. The instructions lack the required imperative statements III. The order in which the instructions should be performed is unclear a)I and II b)II only c)I, II and III d)I only

b)II only

The algorithm below simulates rolling a regular 6-sided die twice. Consider the goal of determining if the sum of the values of the two rolls is odd or even. Step 1: Using a random number generator, get a value between 1 - 6 inclusively Step 2: Remember that number Step 3: Repeat steps 1 and 2 Step 4: Add the two remembered numbers together Step 5: Multiply that sum by 10 Step 6: Divide the result of that multiplication by 2 What conclusions can be made with regard to what we are trying to determine? Select two answers: a)If the value found in step 6 is not 20, 40, 60, 80, 100 or 120 then the sum is odd b)If the last digit of the value found in step 6 is 5, then the sum is odd c)If the value found in step 6 is 10, 20, 30, 40, 50 or 60 then the sum is even d)If the value found in step 6 is 10, 30 or 50 then the sum is odd

b)If the last digit of the value found in step 6 is 5, then the sum is odd -This is correct. Step 4 adds the two randomly generated numbers from steps 1 to 3 together to give a sum. As each of the numbers was between 1 and 6 inclusive, the sum will be an integer from 2 to 12 inclusive. Steps 5 and 6 cause that sum to be multiplied by 10 and then divided by 2: the cumulative result of these steps is that the sum is multiplied by 5. Therefore if the sum was one of the possible odd numbers (3, 5, 7, 9, 11), then the output at step 6 will be one of the following: 15, 25, 35, 45, 55, all of which have a last digit of 5. c)If the value found in step 6 is 10, 20, 30, 40, 50 or 60 then the sum is even. -This is correct. Step 4 adds the two randomly generated numbers from steps 1 to 3 together to give a sum. As each of the numbers was between 1 and 6 inclusive, the sum will be an integer from 2 to 12 inclusive. Steps 5 and 6 cause that sum to be multiplied by 10 and then divided by 2: the cumulative result of these steps is that the sum is multiplied by 5. Therefore if the sum was one of the possible even numbers (2, 4, 6, 8, 10 , 12), then the output at step 6 will be one of the following: 10, 20, 30, 40, 50, 60.

Rick is in charge of a team developing a program which will be used by businesses to control stock. The team has already consulted with potential clients and developed an idea of what inputs will be required and the likely outputs that will be produced from these inputs. Which of the following should Rick and his team do next? a)Write segments of code in different languages to see which language will be most suitable for the job b)Plan the structure of the program and determine how the major algorithms will work c)Decide on the schedule for updates and maintenance of the code d)Make a list of bugs which will occur during development and propose ways these could be fixed

b)Plan the structure of the program and determine how the major algorithms will work.

Which of the following statements about low-level languages are true? Select two answers: a)They are difficult for machines and humans to parse b)They are generally less readable by humans than other languages c)They are very rarely ambiguous d)They are relatively easy for humans to write

b)They are generally less readable by humans than other languages c)They are very rarely ambiguous

Tamara is writing code as part of a large project. She has just compiled her code and run it, but the result is not exactly as expected. Which of the following strategies would be efficient ways to "debug" her code so that it works as intended? Select two answers. a)Retype each statement in the program again, being extra careful not to make mistakes this time. b)Try changing some of the inputs to see under what circumstances the program is not working and what type of error may be occurring. c)Continue to write code, but look for ways in which the error from this part of the program can be corrected or compensated for. d)Add statements to display the state of the program at various points to try and identify where the error might have occurred.

b)Try changing some of the inputs to see under what circumstances the program is not working and what type of error may be occurring. d)Add statements to display the state of the program at various points to try and identify where the error might have occurred.

Erin has written a program which presents a user with multiple-choice quiz questions to answer and calculates a percent score based on the number the user got right or wrong. Each question has 5 possible answers, and scores presented are from 0 to 100 percent inclusive. Which of the following could be represented by a boolean variable? a)The correct answer choice for a particular question. b)Whether a user got a specific question right or not c)The number of questions in the quiz. d)The percent score of the user

b)Whether a user got a specific question right or not

Jama is creating a program which calculates the square roots of whole numbers. The program will store the results of each square-root as a variable. Which of the following data-types would be best used for this variable? a)int b)float c)string d)bool

b)float

Jeremiah is part of a group planning a summer fair at which local businesses can run stalls and events. He wants to use his programming skills to develop an app for the fair which businesses will be able to use to communicate information about their activities at the fair with visitors. Which of the following would be the best first step for Jeremiah to take? a) Write thorough documentation explaining how the code for the app works b) Write some sample code to understand how the app might work c) Find out from the businesses and potential visitors what information and format they think should be used for the app d) Develop all of the major algorithms which will be required for the app by drawing flowchart representations

c) Find out from the businesses and potential visitors what information and format they think should be used for the app -This is correct. The first stage of development should always be to develop the idea and think about what specifically a program should achieve when it is finished. Once the idea is more fully developed a developer can move on to how this might be implemented.

Which of the following should be true of any algorithm? I. The order in which the steps making up the algorithm are followed is logically determined II. Following the instructions in the algorithm will always result in the same outputs, regardless of any inputs III. The instructions in the algorithm contain all necessary information to be implemented a) I only b) II and III only c) I and III only d)I, II and III

c) I and III only -This is correct. The instructions in an algorithm are followed in a logical order, determined by sequencing, selection and iteration. The instructions should be possible to execute from the information given in any algorithm.

Which of the following best describe examples of abstraction a)A series of steps for creating a model aeroplane is laid out in a clear order, with specific instructions in great detail for completing each step. b)Several developers are working on a program together. In order to complete the work efficiently, they split the program up into several parts, and each work on a section, testing as they proceed. When code is complete they add it to a master program. c)A developer writing a program for calculating properties of shapes uses a variable pi to store a decimal approximation of the number π (~3.14159). They use this variable whenever they need to use the number π to calculate an area or volume. d)A sheet of music for guitar is written as a series of chords (e.g C, Am, G7). Each of these represents multiple notes which are played simultaneously on different strings of a guitar.

c)A developer writing a program for calculating properties of shapes uses a variable pi to store a decimal approximation of the number π (~3.14159). They use this variable whenever they need to use the number π to calculate an area or volume. d)A sheet of music for guitar is written as a series of chords (e.g C, Am, G7). Each of these represents multiple notes which are played simultaneously on different strings of a guitar.

Which of the following terms best describes the process of suppressing complex details of a system and presenting a simplified version with just the relevant details? a)Creativity b)Free Thinking c)Abstraction d)Programming

c)Abstraction

Which of the below options would be the best set of instructions to give for a program designed in Scratch? a)Dodge zombies, gain lives, all while trying to make it through the maze! Click start to begin your exciting adventure. b)Make your way through the maze! Avoid the brain-eating zombies and be sure to collect the "hearts" for extra lives. Good Luck! c)Click on the GREEN flag. Once the game starts, use the arrow keys to navigate your way through the maze. In your travels, collect the "hearts" for more lives and avoid being eaten by zombies. d)Ready, set, RUN!!!!! Use your skills and intelligence to weave your way through the maze, avoiding obstacles and prove that you've got what it takes to survive!

c)Click on the GREEN flag. Once the game starts, use the arrow keys to navigate your way through the maze. In your travels, collect the "hearts" for more lives and avoid being eaten by zombies. -This is correct. These instructions are the only set which contain specific instructions for how the user interacts with the game when it is running (using the arrow keys). It also explains how to start the game by using the green flag: a common method used in Scratch to begin a program.

Which of the following best describes "compilation" in reference to computer science? a)Instructions are repeated a set number of times, or until some specified objective is completed. b)Memory is set aside to store variables and instructions so that a program can be executed. c)Code in a high-level language is converted to low-level instructions which can be interpreted and run by the CPU. d)Algorithms which have been planned, for example using flow-charts, are written in code.

c)Code in a high-level language is converted to low-level instructions which can be interpreted and run by the CPU. -This is correct. The CPU of a computer only understands its own machine code, therefore any program written in a high-level language must be compiled (using a program called a compiler) to a set of equivalent instructions in machine code which the CPU can run.

Which of the following best describes "compilation" in reference to computer science? a)Instructions are repeated a set number of times, or until some specified objective is completed. b)Memory is set aside to store variables and instructions so that a program can be executed. c)Code in a high-level language is converted to low-level instructions which can be interpreted and run by the CPU. d)Algorithms which have been planned, for example using flow-charts, are written in code.

c)Code in a high-level language is converted to low-level instructions which can be interpreted and run by the CPU. -This is correct. The CPU of a computer only understands its own machine code, therefore any program written in a high-level language must be compiled (using a program called a compiler) to a set of equivalent instructions in machine code which the CPU can run.

Which of the following describes the part of a computer which stores instructions and information which has been input to the computer? a)Machine Code b)CPU c)RAM d)Binary

c)RAM -This is correct. RAM stands for Random Access Memory. This memory is used to store information short-term, such as instructions to be executed and values to be used in the execution of these

Which of the following describes the part of a computer which stores instructions and information which has been input to the computer? a)Machine Code b)CPU c)RAM d)Binary

c)RAM -This is correct. RAM stands for Random Access Memory. This memory is used to store information short-term, such as instructions to be executed and values to be used in the execution of these instructions.

A statistics teacher wishes to create a program on her calculator that generates a random even integer. The command built in the calculator to generate a random positive integer is RANDOM(a,b). This command generates a random integer between integers a and b (and including a and b). Which of the following lines of code will ensure that the random integer generated will be even? a)RANDOM(a,b) + 2 b)RANDOM(a,b) - 2 c)RANDOM(a,b) * 2 d)RANDOM(a,b) + 1

c)RANDOM(a,b) * 2 -This is correct. The command * typically represents multiplication. Therefore the command RANDOM(a,b) * 2 generates a random integer between a and b inclusive, then multiplies this integer by 2. This will always result in an even number answer.

Consider constructing an algorithm for a robot that can only perform the following three predefined operations. MOVE_FORWARD ( ): The robot moves one square forward in the direction it is facing. ROTATE_LEFT ( ): The robot rotates in place 90 degrees counterclockwise (i.e., makes an in-place left turn). ROTATE_RIGHT ( ): The robot rotates in place 90 degrees clockwise (i.e., makes an in-place right turn). Which of the following algorithms could successfully cause the robot to trace out a "T"-shaped path as drawn above? ____(starts ~> here)_____III a)Step 1: MOVE_FORWARD ( ) Step 2: MOVE_FORWARD ( ) Step 3: ROTATE_RIGHT ( ) Step 4: MOVE_FORWARD ( ) Step 5: ROTATE_RIGHT ( ) Step 6: ROTATE_RIGHT ( ) Step 7: MOVE_FORWARD ( ) b)Step 1: MOVE_FORWARD ( ) Step 2: MOVE_FORWARD ( ) Step 3: ROTATE_LEFT ( ) Step 4: MOVE_FORWARD ( ) Step 5: MOVE_FORWARD ( ) Step 6: ROTATE_RIGHT ( ) Step 7: ROTATE_RIGHT ( ) Step 8: MOVE_FORWARD ( ) c)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: MOVE_FORWARD ( ) d)Step 1: MOVE_FORWARD ( ) Step 2: ROTATE_LEFT ( ) Step 3: ROTATE_LEFT ( ) Step 4: MOVE_FORWARD ( ) Step 5: ROTATE_RIGHT ( ) Step 6: MOVE_FORWARD ( )

c)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: MOVE_FORWARD ( )

Chad has written the majority of his code in Scratch and is ready to start running his program using a variety of carefully chosen conditions to see if it functions properly in all these cases. Which of the following software development terms best describes this process? a)Maintaining b)Implementing c)Testing d)Debugging

c)Testing

The following incomplete algorithm appears in a Scratch script for a sprite, and is intended to draw a rectangle. -pen down -move (myNum) steps -turn (90) degrees -change (myNum) by (100) -move (myNum) steps -turn (90) degrees -change (myNum) by (-50) -move (myNum) by (-50) -move ((myNum) - (50)) steps -turn (90) degrees Which of the following blocks should be added to the end so that this code segment causes the sprite to draw a rectangle as desired? a)move ((myNum) + (100)) steps b)move ((myNum) - (50)) steps c)move ((myNum) + (50)) steps d)move ((myNum) steps

c)move ((myNum) + (50)) steps -This is correct. The length of the first side is equal to the initial value of myNum. The value of myNum is then increased by 100, meaning the second side is 100 longer than the first. The value of myNum is then decreased by 50, making it 50 greater than its original value, and the side drawn is of length myNum - 50, meaning it is the same length as the first (100 less than the second). As the value of myNum is not changed before the 4th side is drawn, it must be drawn at a length of myNum + 50 to make it the same value as the second side, 100 more than the original value of myNum.

Roxanne is writing a program which will be used to display information to passengers on a flight. Some of the variables she will use for her program are as follows. speed - the current speed of the airplane relative to the ground in meters per second passengers - the number of passengers on-board the plane destination - the name of the destination airport of the flight a)speed - string, passengers - int, destination - float b)speed - float, passengers - string, destination - int c)speed - float, passengers - int, destination - string d)speed - int, passengers - float, destination - string

c)speed - float, passengers - int, destination - string

Which of the following variable types is characterized by allowing only two possible values to be stored? a)String b)Float c)Array d)Boolean

d) Boolean

Which of the following best describes high-level computing languages? a)They are extremely difficult for humans to read and understand b)They evolve naturally over time c)They are very easy for machines to understand and parse d)They are not very ambiguous

d) They are not very ambiguous -This is correct. Computer programming languages, in contrast to natural languages, are designed to be as unambiguous as possible. This applies to both low-level and high-level languages.

Consider the following statement which refers to the block (move 10 steps) When you execute this block in Scratch, your computer is actually doing several things: retrieving values from memory representing the direction and position of the sprite, performing an algorithm to update these values, and changing the display in the window to match the updated state of the program. All of these actions are represented by just one single block. Which of the following terms names the phenomenon which is best described by this statement? a)Iteration b)Sequencing c)Compilation d)Abstraction

d)Abstraction

Which of the following statements about variables in programming are true? I. Variables allow a value to be stored for future use II. Once the value of a variable is set it cannot be changed III. The name given to a variable is important for human comprehension, but not for the computer. a)I only b)I, II and III c)II only d)I and III only

d)I and III only

Microsoft Excel® is a spreadsheet program that can be used for computing the average of a list of values in cells A1 through A20 with a command such as =AVERAGE(A1:A20). After the user initiates this command, the command disappears and the average (or mean) of the list of numbers appears. Why is this an abstraction? a)There is an equal sign present in the command. b)There is math being used in order to calculate the average. c)There are steps that are followed in order to complete the calculations. d)The average can be viewed without knowing the process of how the average was computed.

d)The average can be viewed without knowing the process of how the average was computed.

Which of the following best describes how a compiled program is run by a computer? a)The instructions are read directly from the computer hard disk, and the RAM and CPU work separately to execute different parts of the code as it is read. b)The instructions stored in the CPU are sent to RAM, where they are read and executed. Outputs for the program are then sent back to the CPU so they can be displayed c)The CPU converts instructions into binary. RAM is used to look through and interpret these instructions which are then executed by the CPU. d)The binary instructions from the program are loaded into RAM. The CPU reads and executes instructions, storing and accessing data from RAM as needed.

d)The binary instructions from the program are loaded into RAM. The CPU reads and executes instructions, storing and accessing data from RAM as needed. -This is correct. This roughly describes how a program is executed. When a program has been compiled, it is converted into machine code (written as binary numbers), understandable by the CPU (Computer Processing Unit) which is the part of a computer which performs operations and calculations. RAM (Random Access Memory) is a short-term memory which is used by a computer to store data such as instructions and variables it needs to complete tasks.

Which of the following best describes how a compiled program is run by a computer? a)The instructions are read directly from the computer hard disk, and the RAM and CPU work separately to execute different parts of the code as it is read. b)The instructions stored in the CPU are sent to RAM, where they are read and executed. Outputs for the program are then sent back to the CPU so they can be displayed. c)The CPU converts instructions into binary. RAM is used to look through and interpret these instructions which are then executed by the CPU. d)The binary instructions from the program are loaded into RAM. The CPU reads and executes instructions, storing and accessing data from RAM as needed.

d)The binary instructions from the program are loaded into RAM. The CPU reads and executes instructions, storing and accessing data from RAM as needed. -This is correct. This roughly describes how a program is executed. When a program has been compiled, it is converted into machine code (written as binary numbers), understandable by the CPU (Computer Processing Unit) which is the part of a computer which performs operations and calculations. RAM (Random Access Memory) is a short-term memory which is used by a computer to store data such as instructions and variables it needs to complete tasks.

Which of the following best describes why the development process by which computer programs are created is described as "iterative"? a)The process begins with planning and design phases before any of the implementation begins. b)The process is a cycle, with results from one run of the cycle feeding into the next. c)The steps in the process must be strictly followed one after another. d)Evaluation and testing may take place throughout the process and not just at the end.

d)The process is a cycle, with results from one run of the cycle feeding into the next.

Which of the following is the MOST important reason computers use artificial languages over natural language? a) The syntax of natural languages is easy to translate by computers b)The meaning of different characters and words in an artificial languages is explicit and unambiguous c)The meaning of different characters and words in an artificial languages is too complicated d)The syntax of artificial languages is explicit and unambiguous

d)The syntax of artificial languages is explicit and unambiguous -This is correct. An artificial language, such as a programming language, is much easier for computers to understand as the syntax can be made unambiguous: a series of well-defined rules allow each expression to always be interpreted in the same way by the computer.

Which of the following is the MOST important reason computers use artificial languages over natural language? a)The syntax of natural languages is easy to translate by computers b)The meaning of different characters and words in an artificial languages is explicit and unambiguous c)The meaning of different characters and words in an artificial languages is too complicated d)The syntax of artificial languages is explicit and unambiguous

d)The syntax of artificial languages is explicit and unambiguous -This is correct. An artificial language, such as a programming language, is much easier for computers to understand as the syntax can be made unambiguous: a series of well-defined rules allow each expression to always be interpreted in the same way by the computer.

Which of the following best describes high-level computing languages? a)They are extremely difficult for humans to read and understand b)They evolve naturally over time c)They are very easy for machines to understand and parse d)They are not very ambiguous This is correct. Computer programming languages, in contrast to natural languages, are designed to be as unambiguous as possible. This applies to both low-level and high-level languages.

d)They are not very ambiguous -This is correct. Computer programming languages, in contrast to natural languages, are designed to be as unambiguous as possible. This applies to both low-level and high-level languages.

Which of the following is an example of code written in a high-level programming language? a)00101100 01010000 11011000 10110111 b)Add the number 2 to the number 5, then subtract this from the number 10 and display the answer. c)LD R0 8 LD R1 3 SUB R1 R0 LD R2 1 ADD R2 R0 ST R0 X d)num1 = 8 - 3 num2 = 2 * num1 + 1 print(num2)

d)num1 = 8 - 3 num2 = 2 * num1 + 1 print(num2)


Related study sets

CHAPTER 3 - The Colonies Take Root

View Set

Life and Health (Practice Questions)

View Set

Intermediate Accounting II - Test 3 (Chapter 8, 19 & 20)

View Set