Computer Science Practice Final

Ace your homework & exams now with Quizwiz!

What would display when running the code below? valueOne ← 8 valueTwo ← 2 valueThree ← 5 valueFour ← valueOne MOD valueTwo valueFour ← valueFour * valueThree 0 20 30 50

0

Consider the following code: REPEAT UNTIL (x mod 2 = 1){x ← x + 3} Assume that x is initially 6. How many times will the loop iterate? 0 1 2 3

1

If the variable score has a value of 10 at the beginning of a program, which runs according to the following flowchart, what will the value of score be at the end? 10 10.5 11 13.5

10

What will be the output for the following line of code? DISPLAY(5 * 2) 2.5 7 10 25

10

What will the final value of a be, after running the script below? 3 9 12 18

18

What will be the output for the following code snippet? a ← 12 b ← a / 2 c ← a * 2 a ← c + 2 DISPLAY(c) 6 12 24 26

24

Which of the following is an advantage that block-based programming languages (e.g. Scratch) have over text-based programming languages (e.g. Processing, Python, Java, etc)? Block-based programming languages allow programmers to write programs in English and other natural languages Block-based programming languages offer programmers more detailed control over lower-level functionality when writing a program. Block-based programming languages do not require the programmer to worry about syntax, capitalization, or punctuation. Programs written in block-based programming languages do not require debugging.

Block-based programming languages do not require the programmer to worry about syntax, capitalization, or punctuation.

An entrepreneur has hired a programmer to design software to take user input and convert it to appear a certain way. The programmer is not clear on the assignment, so he asks the entrepreneur to elaborate. Which of the following would be most helpful for the programmer to ask the entrepreneur to do to make the assignment clearer? Give some examples of user input and what the result should look like Select the most appropriate language for the application Sit side-by side throughout the debugging process Write some sample code to show the programmer exactly what he wants

Give some examples of user input and what the result should look like

Which of the following statements about high-level programming languages when compared to low-level programming languages is true? High-level programming languages provide programmers with more abstractions and are easier for people to read High-level programming languages provide programmers with more abstractions but are more difficult for people to read High-level programming languages provide programmers with less abstractions but are easier for people to read High-level programming languages provide programmers with less abstractions and are more difficult for people to read

High-level programming languages provide programmers with more abstractions and are easier for people to read

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. I & III only II & III only III only I, II, & III

I & III only

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 I only I & III only II & III only I, II, & III

I, II, & III

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

II only

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? Idea→algorithm→write code→debug→execute code→maintain Idea→algorithm→write code→execute code→debug→maintain Idea→algorithm→write code→execute code→maintain→debug Idea→write code→algorithm→execute code→debug→maintain

Idea→algorithm→write code→execute code→debug→maintain

A standard deck of playing cards contains 52 cards, with each card being one of four suits: SPADES, HEARTS, CLUBS, and DIAMONDS. Each suit is represented by 13 cards whose values include ACE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, and KING. Consider the following two algorithms that are intended to find the card representing the "TEN of HEARTS" in a randomly shuffled deck and separate it from the other 51 cards in the deck. Algorithm A Step 1: Pick up the shuffled deck of cards.Step 2: Look at the topmost card in your hands.Step 3: If the card's suit is a HEART, place the card on top of the pile to your left.Step 4: Otherwise, place the card on top of the pile to your right.Step 5: Repeat steps 2 through 4 until you are no longer holding any cards.Step 6: Pick up the cards in the pile to your left.Step 7: Look at the topmost card in your hands.Step 8: If the card's value is a TEN, place all other cards in your hands on top of the pile to your right.Step 9: Otherwise, place the card on top of the pile to your right.Step 10: Repeat steps 7 through 9 until you are holding only one card.Step 11: The only card in your hand is the TEN of HEARTS. Algorithm B Step 1: Pick up the shuffled deck of cards.Step 2: Look at the topmost card in your hands.Step 3: If the card's suit is a HEART or the card's value is a TEN, place all other cards in your hands on top of the pile to your right.Step 4: Otherwise, place the card on top of the pile to your right.Step 5: Repeat steps 2 through 4 until you are holding only one card.Step 6: The only card in your hand is the TEN of HEARTS.

Only Algorithm A will always work as intended.

You get a text message from a vendor, saying your account has been compromised. You use this service and think the message might be realy. The message asks you to click on a link to renew your password so that you can log in to its website. You should: Click on the link. If it takes you to the vendor's website, then you'll know it's not a scam. Pick up the phone and call the vendor, using a phone number you know to be correct, to confirm that the request is real. Reply to the text, asking if you really need to renew your password.

Pick up the phone and call the vendor, using a phone number you know to be correct, to confirm that the request is real.

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? Decide on the schedule for updates and maintenance of the code Make a list of bugs which will occur during development and propose ways these could be fixed Plan the structure of the program and determine how the major algorithms will work Write segments of code in different languages to see which language will be most suitable for the job

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

Which of the following best describes the type of language used in the below algorithm? Prompt user for number if number is greater than or equal to 0 Output "Positive" else Output "Negative"Repeat 4 times High-level Language Low-level Language Natural Language Pseudocode

Pseudocode

Peter wrote the following code in scratch to make a sprite perform a series of coordinated moves, forming a "dance routine." The code will be used for a competition, and Peter does not want to reveal the moves performed by the sprite in his program. Currently the path taken by the sprite is traced on the screen. Which of the following changes to the code will change this and allow Peter to keep the path taken by his sprite hidden? Removing the block Removing the pen down block Removing the block Removing the block

Removing the pen down block

As part of the lifecycle of a program, after a computer programmer writes the code, it is then compiled and usually used to create an executable file to be run on the CPU. The code that is run through the compiler is known as what? Binary Code Machine Code RAM Source Code

Source code

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 will successfully cause the robot to trace out a square-shaped path, with the robot ending up in its original position and facing in its original direction? Step 1: MOVE_FORWARD ( ) Step 2: ROTATE_RIGHT ( ) Step 3: MOVE_FORWARD ( ) Step 4: ROTATE_RIGHT ( ) Step 5: MOVE_FORWARD ( ) Step 6: ROTATE_RIGHT ( ) Step 7: MOVE_FORWARD ( ) Step 1: MOVE_FORWARD ( ) Step 2: MOVE_LEFT ( ) Step 3: MOVE_BACKWARD ( ) Step 4: MOVE_RIGHT ( ) Step 1: MOVE_FORWARD ( ) Step 2: ROTATE_LEFT ( ) Step 3: MOVE_FORWARD ( ) Step 4: ROTATE_LEFT ( ) Step 5: MOVE_FORWARD ( ) Step 6: ROTATE_LEFT ( ) Step 7: MOVE_FORWARD ( ) Step 8: ROTATE_LEFT ( ) Step 1: MOVE_FORWARD ( ) Step 2: TURN_LEFT ( ) Step 3: Repeat steps 1 and 2 four more times

Step 1: MOVE_FORWARD ( ) Step 2: ROTATE_LEFT ( ) Step 3: MOVE_FORWARD ( ) Step 4: ROTATE_LEFT ( ) Step 5: MOVE_FORWARD ( ) Step 6: ROTATE_LEFT ( ) Step 7: MOVE_FORWARD ( ) Step 8: ROTATE_LEFT ( )

A group of high school students is participating in a mobile application development contest. They have a limited time frame and would like to add many features. Which of the following strategies will allow them to create the best app they can in the time allotted? Strategy I:The students outline all goals. They make a program with all procedure names. They use software to simultaneously work on different parts of the code, frequently compiling and testing all code together. As each individual student completes one procedure, that student moves onto the next procedure. Strategy II:The students outline all goals. They work together on some shared code, and students work with their own copies of the code on specific parts. They check in regularly and completed, correct code is added to a master program. Strategy I only Strategy I and Strategy II will both allow the students to create a quality application Strategy II only Neither Strategy I nor Strategy II will allow the students to create a quality application

Strategy II only

Consider the following algorithm which uses an integer variable n. Double the value of n Add 34 to the answer Round the answer to the nearest ten Sum the digits of the answer Display the final answer Which of the following statements best describes the predictability of the results when this algorithm is run on a computer? The algorithm always displays the same answer, regardless of the value of n. The answer displayed by the algorithm can be predicted for some values of n, but not for others. The answer displayed by the algorithm for any known value of n can always be predicted. It is impossible to predict the value of the answer displayed, even if the value of n is known.

The answer displayed by the algorithm for any known value of n can always be predicted.

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? The average can be viewed without knowing the process of how the average was computed. There is an equal sign present in the command. There are steps that are followed in order to complete the calculations. There is math being used in order to calculate the average.

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? The bits from the program are loaded from memory then read and executed by the processor. The instructions are read directly from the computer hard disk, and the memory and processor work separately to execute different parts of the code as it is read. The instructions stored in the processor are sent to memory, where they are read and executed. Outputs for the program are then sent back to the processor so they can be displayed The processor converts instructions into bits. Memory is used to look through and interpret these instructions which are then executed by the processor.

The bits from the program are loaded from memory then read and executed by the processor.

What will happen if the code below is run, and the condition for the if block is false? The code within the forever loop will continue to execute, constantly checking the condition for the if block The program will execute the blocks within the if condition (represented by the do stuff block) The program will exit the forever loop and continue by executing the blocks beneath this code None of the options listed above

The code within the forever loop will continue to execute, constantly checking the condition for the if block

A program has been developed to compute the sum of all elements with a value greater than 10 in a list of integers. Which of the following statements best describes how iteration may be used to in the program in this example? The program will execute the commands for finding and adding the numbers in the order in which they appear in the program. The program will initiate a variable at the beginning and return the value of that variable at the end. The program will only execute a command which adds a value in the list to a running total if that value is greater than 10. The program will repeat the execution of a block of commands which test the value of an item and add it to a running total (if it is greater than 10) for each value in the list.

The program will repeat the execution of a block of commands which test the value of an item and add it to a running total (if it is greater than 10) for each value in the list.

You receive an email from your school's head of IT. There is a concern for a potential hack to the school's servers. IT knows some accounts have been compromised, with their login and passwords overwritten by the hackers. They need to reset the accounts that the hackers have changed the passwords on. However, they don't have access to the passwords directly, and the change records were corrupted by the attack. They need students and staff to confirm their passwords by logging into a secure site. If the login fails, they'll know your account was compromised and reset your account immediately. This could be a phishing attempt. If the situation is as described in the email, this is also serious, but the method suggested is the same methods used by social hackers. Look up your IT Departments phone number and call them about the email. This is a serious issue, and the email came from the head of IT. The site also shows that it's secure. The longer it takes to reset accounts, the longer the hackers will have access to your account. Follow the instructions in the email from the head of IT.

This could be a phishing attempt. If the situation is as described in the email, this is also serious, but the method suggested is the same methods used by social hackers. Look up your IT Departments phone number and call them about the email.

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? The correct answer choice for a particular question. The number of questions in the quiz. The percent score of the user Whether a user got a specific question right or not

Whether a user got a specific question right or not

In a flowchart, a typical decision symbol has what type of output? boolean (true/false) numerical text none of these

boolean (true/false)

Which of the following would be the best way to get the robot from its starting position, to its ending position? left() left() left() down() down() forward() forward() forward() turnLeft() forward() forward() forward() forward() forward() turnRight() forward() forward() turnLeft() forward() forward() turnRight() forward() forward() forward()

forward() forward() forward() turnLeft() forward() forward()

Consider the following code segment that appears in the middle of a program. Which of the following can replace the missing statement in the REPEAT UNTIL block so that the user will be required to enter the correct password of "swordfish" before they can continue on with the rest of the program. "swordfish" userPassword ← INPUT userPassword = "swordfish" userPassword ≠ "swordfish"

userPassword = "swordfish"

A program that swaps the values stored/assigned in the variables valueOne and valueTwo. Which of the following examples of Pseudocode acurately depict this program? valueOne ← #1 valueTwo ← #2 valueOne ← valueTwo valueTwo ← valueOne valueOne ← #1 valueTwo ← #2 valueTwo ← valueOne valueOne ← valueTwo valueOne ← #1 valueTwo ← #2 placeHolder ← valueOne valueOne ← valueTwo valueTwo ← placeHolder valueOne ← #1 valueTwo ← #2 valueOne ← #2 valueTwo ← #1

valueOne ← #1 valueTwo ← #2 placeHolder ← valueOne valueOne ← valueTwo valueTwo ← placeHolder

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) (X > 0) AND (X < 15) (X > -5) AND (X ≤ 20) (X < 0) AND (X > 15) (X < -5) AND (X ≥ 20)

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

x ← 0a ← 3k ← 4REPEAT a TIMES{ REPEAT k TIMES { x ← x + a } x ← x * (-1)}DISPLAY x When the code above is run, what will be the final value of the variable x, displayed at the end of the program? -12 -9 9 12

-12

What will be the output for the following line of code? DISPLAY(5 MOD 2) 0 1 2.5 7

1

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 6 33 38 48

48

Consider the following: Which of the following values is displayed if the user inputs the following list of values for each prompt? 1 2 3 4 5 6 7 8 9 15 3 4 5 6

6

What will be the output of this code? a ← 2 b ← 6 c ← 12 a ← b b ← c DISPLAY(a) DISPLAY(c) 2 6 2 12 6 12 12 12

6 12

Which of the following is a valid reason for giving variables meaningful names in a program? A programmer will find it easier to read and understand the code since they will know what the variables represent. The code will run with fewer errors since the CPU can interpret what the variable represents from its name. The compiler will be able to parse the code faster since it will know the purpose of each variable. The memory required to store the variables will be reduced as the possible values which can be stored by each variable can be determined from their names.

A programmer will find it easier to read and understand the code since they will know what the variables represent.

Which of the following best describes how abstraction makes code written in higher-level programming languages easier for humans to parse? Abstractions used in higher-level languages make the code closer to the actual individual operations performed by the CPU Abstractions used in higher-level languages make them almost identical to a natural language which would be spoken by humans. 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. Abstractions used in higher-level languages remove any potential ambiguity from the code

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 is not a Control Flow method Algorithm Iteration Selection Sequence

Algorithm

Many tasks, large and small, can be solved by performing a specific set of actions and making a particular set of decisions in very precise ways. These sets of actions and decisions are known as what? Abstraction Algorithms Building Blocks Processes

Algorithms

Which of the following is a reason for the importance of variables in programming? Variables allow you to change a value used in multiple places in a program easily. Variables allow you to store values calculated by the program and access them at a later point in the program. Variables assist in making code more readable. All of these are correct

All of these are correct

Which is NOT true about comments in programs? All published programs have their comments available. Commenting about program components helps in developing and maintaining programs. Commenting helps programmers develop and maintain programs to efficiently solve problems. Commenting helps while working collaboratively in programming environments

All published programs have their comments available.

BIOS is an acronym for Basic Input Output Software Basic Input Output System Basic Integer Operating Software Binary Integer Operating System

Basic Input Output System

The CPU can handle ________ of instructions a second Hundreds Thousands Millions Billions

Billions

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

Boolean

The program below calculates and displays the sum of the integers from m to n inclusive, where m < n. Line 1: i ← mLine 2: r ← n-m+1Line 3: sum ← 0Line 4: REPEAT r TIMESLine 5: {Line 6: sum ← sum+iLine 7: i ← i+1Line 8: }Line 9: DISPLAY sum If Line 1 is changed to read i ← n, which of the following changes will ensure that the program continues to calculate and displays the sum of the integers from m to n inclusive? Change line 2 to read r ← m-n+1 Change line 3 to read sum ← n Change line 6 to read sum ← sum-i Change line 7 to read i ← i-1

Change line 7 to read i ← i-1

Consider the code segment below. Line 1: IF (b ≠ 0) Line 2: { Line 3: a ← a/b Line 4: } Line 5: ELSE Line 6: { Line 7: a ← a*b Line 8: } Which of the following changes will NOT affect the results when the code segment is executed? Changing line 3 to a ← b Changing line 3 to b ← a/b Changing line 7 to a ← 0 Changing line 7 to a ← a/b

Changing line 7 to a ← 0

If "h" is contained inside the variable exampleForQuestion, what type of data does exampleForQuestion hold? Boolean Character Integer String

Character

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

Code written in a language like Python is converted to bits which can be interpreted and run by the CPU.

"The iteration (repetition) pattern repeats a set of instructions until a certain <missing word> is met." Which of the following words should be used to replace <missing word>? Action Condition Goal Node

Condition

Subana is writing a program which will calculate the mean average of a set of numbers by adding the numbers and dividing the result by the amount of numbers. She will use a variable, avg, to store this average. Which variable type would be most suitable for avg? Boolean Floating Point Integer String

Floating Point

An email from your boss says your most recent customer may have used a fake credit card. Your boss needs the name, addresses, and credit card information of your customer to report it to the IRS. The email says it's urgent and to please reply right away. You should reply with the information right away. True, your boss wouldn't request it by email if it wasn't important. False, email isn't always secure and you should verify that the request is ligitimate, and make sure you know how to send the information in a secure way.

False, email isn't always secure and you should verify that the request is ligitimate, and make sure you know how to send the information in a secure way.

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? Develop all of the major algorithms which will be required for the app by drawing flowchart representations Find out from the businesses and potential visitors what information and format they think should be used for the app Write some sample code to understand how the app might work Write thorough documentation explaining how the code for the app works

Find out from the businesses and potential visitors what information and format they think should be used for the app

Which of the following is used in the instructions below to determine how the task of "having breakfast" will be performed? Dump cereal in bowl Pour milk in bowl Eat cereal and milk Place spoon and bowl in dishwasher Sequencing Selection Iteration I only I & II only II & III only I, II, & III

I only

Which of the following best describes the result of running the program below? number ← RANDOM (1, 6)REPEAT UNTIL number > 100{ number ← number * 2}IF (number = 128){ DISPLAY (true)}ELSE{ DISPLAY (false)} If number is a 1, 2 or 4, then the program will display true. If number is a 2, 4 or 5, then the program will display true. If number is originally even, then the program will display true. If number is originally odd, then the program will display true

If number is a 1, 2 or 4, then the program will display true.

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? Accept () Command () Input () Read ()

Input ()

Tom created the following code segments in Scratch, which are intended to create a short piece of music between them. When the green flag is clicked, each of the three scripts is intended to run in turn, however, due to a mistake in the code, this does not happen. Which of the following changes could Tom make to ensure that all three of the scripts run as intended? Delete the block Replace the block (broadcast sound3) with the block (broadcast sound2) Both of the above None of the above

Replace the block (broadcast sound3) with the block (broadcast sound2)

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? Language A is ambiguous because it is unclear what sun, mon, tue, wed, thu, fri, and sat refer to in context with the problem. Language B is ambiguous because the process of "average" is not explained well Neither of these languages is clear enough that a programmer could write a correct solution in a high-level programming language. The algorithms in both languages are ambiguous because they do not specify the actual values of the seven daily rainfall totals.

Language B is ambiguous because the process of "average" is not explained well

Which of the following types of languages is optimized for machine processing and may be written and expressed as a series of binary digits (e.g., ones and zeros), making it difficult for humans to read and write? High-level languages Low-level languages Natural Language Pseudocode

Low-level languages

Consider the given code: 1 integer ← 22 2 lowtemp ← 0 3 4 IF(integer < 10) 5 { 6 lowtemp ← lowtemp - 5 7 } 8 ELSE 9 { 10 lowtemp ← lowtemp + 10 11 } 12 13 DISPLAY(lowtemp) What is the best description of the structure implied by line 4? Algorithm Iteration Selection Sequencing

Selection

Using the flowchart below, what value when entered for Y will generate a mathematical error and prevent our flowchart from being completely executed? 0 1 3 None of these values will produce a mathematical error

None of these values will produce a mathematical error

The following is the only script attached to a sprite in Scratch. Which of the following best describes what will be drawn on the screen when the green flag is clicked (you may assume the sprite starts in the center of the screen with all default settings)? A circle A square A triangle Nothing will be drawn; the program lacks a pen down command.

Nothing will be drawn; the program lacks a pen down command.

The critical component's of your computer's architecture are: Mouse, Motherboard, Integrated Circuits, Wires Peripherals, BIOS, CPU, Programs, Memory Programs, Bits, Bytes, HTML, Wires, Plastic, Silicon Wires, Plastic, Silicon

Peripherals, BIOS, CPU, Programs, Memory

Legitimate or Phishing?

Phishing

Which of the following is an important step to take before beginning to write the code for a program? Plan the logic and anticipated input/output of the code Plan an update and maintenance schedule for the program Randomly generate the variable names to be used in the program Write on paper or a whiteboard all the code you intend to type

Plan the logic and anticipated input/output of the code

If "Hello World" is contained inside the variable exampleForQuestion, what type of data does exampleForQuestion hold? Boolean Character String Floating Point

String

If we run the program below, what will be the result? n ← 4 x ← -2.5 IF(n < 3){ DISPLAY("Team A") }ELSE{ IF(n < 2) { DISPLAY("Team B") } ELSE { IF(x > -2) { DISPLAY("Team C") } ELSE { DISPLAY("Team D") } } } Team A Team B Team C Team D

Team D

Which of the following could be considered part of the beginning "state" of a Scratch program?

The background image The value of a variable Visibility of sprites All of the options listed

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? The instructions do not contain any selection or iteration statement The instructions lack descriptive qualifiers The instructions lack imperative statements The sequencing of the instructions is unclear

The instructions lack descriptive qualifiers

Consider the following code: IF (n > 0){ DISPLAY ("The number is positive.")}ELSE{ DISPLAY ("The number is not positive.")} What will be output by this code if the number n is zero? The number is positive. The number is not positive. Both of the above Neither of the above

The number is not positive

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

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

scratch is a Flow-based Language Typed Language Visual Programming Language

Visual Programming Language

Which of the following could be represented by a boolean variable? The direction a car proceeds in at a 4-way intersection The number of tech support requests made in a day Whether a guest at a wedding is allergic to peanuts The weight of a truck as recorded at a weigh-station

Whether a guest at a wedding is allergic to peanuts

Imagine you are programming a simple calculator using Scratch and you want to create a feature which adds a fixed number to an existing variable named "balance". Which of the blocks below will be the most appropriate to use for this feature? change (balance) by () change x by () say (balance) set (balance) to ()

change (balance) by ()

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? boolean float int string

float

Scratch is a binary language high-level language low-level language machine language

high-level language

Marta is writing a program for a home-automation system. Three of the variables in her program are as follows: l ight - 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? light - boolean, temp - integer, name - string light - boolean, temp - string, name - integer light - integer, temp - boolean, name - string light - string, temp - integer, name - boolean

light - boolean, temp - integer, name - string

What part of a computer stores instructions and information which has been input to the computer? bios bits memory processor

memory

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

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

What is a good way to help show your interests and soft skills to possible universities and employers? interview portfolio resume transcript

portfolio

Which of the following is often an under-reported, but important part of what universities and employers are looking for? hard skills high grades soft skills test scores

soft skills

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 secondpassengers - the number of passengers on-board the planedestination - the name of the destination airport of the flight Which of the following correctly describes the types which would be best used for each of these variables? speed - float, passengers - int, destination - string speed - float, passengers - string, destination - int speed - int, passengers - float, destination - string speed - string, passengers - int, destination - float

speed - float, passengers - int, destination - string

Joanna wishes to create a variable in her Scratch game which records the number of seconds until the game ends. Which of the following would be the most appropriate name for this variable? amountOfTimeRemainingInTheGame t time_left Variable1

time_left

Sam and Emma are creating a multiplayer tic-tac-toe game. Below is a segment of their code that is used so that the Sprite on screen can tell the user whose turn it is. Before each user's turn, this set of code is run. What would condition 1 need to be so that this part of the program runs correctly? The variable turn is initialized as 0 at the start and player 1 always goes first. turn > 0 turn = 1 turn MOD 2 = 0 turn MOD 2 = 1

turn MOD 2 = 1

A program that stores the value 2 into a variable called valueOne, then stores the value 3 into a variable called valueTwo. Lastly, the program stores the sum of variables valueOne and valueTwo into a new variable called sumValues. Which of the following examples of Pseudocode acurately depict this program? 2 ← valueOne 3 ← valueTwo 5 ← sumValues valueOne ← 2 valueTwo ← 3 sumValues ← 2 + 3 valueOne ← 2 valueTwo ← 3 sumValues ← valueOne + valueTwo valueOne ← 3 valueTwo ← 2 sumValues ← 5

valueOne ← 2 valueTwo ← 3 sumValues ← valueOne + valueTwo


Related study sets

Physics Exam 2 Concept Questions

View Set

Abeka, Science: Earth and Space, Semester Exam (Test 6)

View Set

Real Estate chapter 4: Unit 4 Financing

View Set

Overview of The Scrum Development Process

View Set

Knewton Alta Lesson 5 Assignment

View Set