ICT Programming and Logic All Questions

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

Melissa is testing a new video game for her roommate. She is playing the game and gets to the door at the end of the first level. As she opens the door, the game just stops running. What is most likely causing the game to stop?

A runtime error

Veronica has written a computer program that locates records in a database. During testing, the program suddenly stops running. What is most likely causing the program to stop running?

A runtime error

Which of the following best defines the term "algorithm"?

A set of step-by-step instructions to solve a problem or perform a task

Consider the general problem-solving steps shown: 1. Create the procedures needed to execute the solution 2. Use logic to plan a solution to the problem 3. Test and refine the solution 4. Identify and understand the problem

4, 2, 1, 3

Consider this recipe algorithm: 1. Preheat oven to 375 degrees 2. Grease and flour a cake pan 3. Add the next ingredient to the large bowl 4. Stir the contents of the bowl until blended 5. Pour the batter into the cake pan 6. Bake 30 minutes Which instruction in this algorithm would be considered a loop structure?

Add the next ingredient to the large bowl

Consider the following example: Problem: Tara has 15 tickets. Dean has 10 tickets. Tara gives Dean 2 tickets. How many more tickets does Tara have than Dean? Solution: Tara's tickets: 15 Subtract 2 tickets from Tara's total tickets:15- 2 = 13 Dean 's tickets: 10 Add 2 tickets to Dean's tickets:10 + 2 = 12 Subtract Tara's total tickets from Dean's total tickets:13 - 12 =1 Answer: Tara has one more ticket than Dean. Which term describes the instructions presented in this example?

Algorithm

Binary is based on which number system?

Base 2

Which term is used to describe the use of zeroes and ones in a sequence to represent data?

Binary

Which term describes a series of zeros and ones that represent the basic unit of data that a computer processes?

Byte

Ravi is programming in C++. This type of language is translated entirely into machine language before use. What type of language is Ravi programming in?

Compiled

Which type of language is translated entirely into machine language before use?

Compiled

Anna is asked to explain the differences between compiled and interpreted languages in her programming class. Which statement would be her best response?

Compiled languages usually execute faster than interpreted languages.

Which statement is true regarding compiled and interpreted languages?

Compiled languages usually execute faster than interpreted languages.

Salena is now in her second year as a programmer. She knows that she can determine the order in which instructions are executed, as well as the number of times (or even if) an instruction is executed. What is the term for this?

Control structures

What enables a programmer to determine the order in which instructions are executed, as well as the number of times (or even if) an instruction is executed?

Control structures

Your teacher has asked you to find the average of a list of numbers. You have determined that the first step is to add the list of numbers. What is the next logical step needed to solve the problem?

Count the number of items in the list.

The program that Nina and her team have been working on has run its initial test. A few unexpected errors occurred. The team now needs to identify the causes of these errors and make corrections to the program so that it performs the way it was intended. This process is known as:

Debugging

What is the process that a programmer uses to identify errors and make corrections to a program that does not perform the way it was intended or produces incorrect results?

Debugging

Which term is also used to describe the selection control structure?

Decision

Mr. Silverman and his class cannot use the computer lab at the moment. He hands the students the print-out of the programming code from their current projects and then has them work through their code with a pencil. What task are the students performing?

Desk checking

Which term describes the testing method used by programmers to work through program code by hand using a pencil and paper?

Desk checking

Start---> Select a number from the list -->______________--> Is the answer a whole number --> yes--> it is an even number or no--> it is an odd number This flowchart provides steps for determining whether a number is even or odd. Which statement should be inserted in the empty rectangle to correctly determine the solution?

Divide the number by 2

Mr. Simmons asks the class to create an algorithm to find out if each number on a list is odd or even. Peter creates a flowchart to help visualize his algorithm. The first step is to select a number from the list. What is the next logical step to solve the problem?

Divide the selected number by two.

Rosie has created a computer program, tested it and made revisions. To grade it, her professor runs it and watches the code. What is it called when the computer performs the instructions contained in the program?

Executing

What is the term for a graphical diagram that uses symbols to represent the steps contained in a program?

Flow chart

Isabella and her team are creating a program for their group project. They have a plan and can talk their way through the algorithm. They decide to use a graphical diagram that uses symbols to represent the steps. What is this diagram called?

Flowchart

Horatio is interested in computer programming languages, but he has very little experience in using them. Which type of programming language should he explore because it is easier to learn, use, read and modify?

High-level

Haruto is a high school student who has never taken a programming course. He wants a programming language that is easy to learn, that contains English words and phrases, as well as easily recognized symbols. The counselor recommends a Javascript course. What type of programming language is this?

High-level language

Felix and his team are given a mission to create a program that finds the average age (in the total number of days, not years) of the students at their school. What should be their first step for creating an algorithm to solve a problem?

Identify and understand the problem.

Jasmine and her team are creating an animated maze game that responds to the keys pressed on the keyboard. The team meets to discuss the game objectives and key components of the program. They create a list of objectives for designing the game. Which problem-solving activity did the team complete in this first meeting?

Identify and understand the problem.

What is the first step for creating an algorithm to solve a problem?

Identify and understand the problem.

Consider the loop control structure in programming. Which term describes a loop that continues repeating without a terminating (ending) condition?

Infinite loop

Robert is programming a small, solar-powered mowing robot that is designed to be always running and mow a very large property. The robot is expected to mow "forever" and should not have a terminating condition to the programming. Which term describes this loop structure?

Infinite loop

Charles is coding a role-playing game. He has created code that asks a player for their name and assigns it to the "name" variable. Charles assigns the first value for the variable as Player 1 until a player inputs their information. What is the term for assigning this value for the "name" variable?

Initializing

Which program translates a number of program instructions, waits for the computer to execute them, and then translates the next series, until the program is fully executed?

Interpreter

Raphael is asked in his programming class to describe a benefit of structured programming. Which of the following would be the best response for Raphael to give?

It divides the problem into smaller, more manageable tasks that are performed in a sequence to solve the larger problem.

Which statement is true regarding structured programming?

It divides the problem into smaller, more manageable tasks that are performed in a sequence to solve the larger problem.

Luigi has created a program for a game that has a "monster" character appear from a "cave" in the middle of the screen, move randomly off the edge of the screen and then reappear in the cave. It repeats while the game is played. What is another term for this loop control structure?

Iteration

Which term is also used to describe the loop control structure?

Iteration

Scott has written a program to add together a group of numbers and then divide the total by the number of items added to produce the average value. When he tested the program, he noticed that the program is multiplying the total by number of items, not dividing as he intended. Which type of programming error has mostly likely occurred?

Logic

Sebastian has created a program that calculates shipping cost. For every pound of product, the customer should be charged $1.00. When he tests the program with a product that weighs 5 pounds, the shipping cost is calculated to $20. What type of error has occurred that produces the unexpected results?

Logic

You are creating a computer program that calculates the total cost of an item after sales tax has been added. You have been testing the program using a cost of $10.00 and 10% sales tax. You know that the answer should be $11.00, but the program returns an answer of $9.00. Which type of error is most likely causing this unexpected result?

Logic

Frank has written code for his video game that makes the character move to the left while the player presses the left-arrow key. Which type of control structure is this?

Loop

Jackson is creating a program that asks users four random questions. The question list is 20 questions long. He wants the program to ask the first random question, remove it from the list, and then ask another, remove it and repeat until only four questions are asked. Which control structure is Jackson using?

Loop

Which control structure includes the do/while statement?

Loop

Which control structure repeats a set of instructions until some condition is met?

Loop

You have written a program that asks the user for a number and then multiplies the number by 2, ten times before the program ends. Which type of control structure is this?

Loop

What is the only language that a computer can understand?

Machine

Olivia thinks that her first program code is quite good and that it will run well. She is surprised to learn that the computer, however, is not able to understand the language her code is written in, without first translating it. What is the only language that a computer can understand without needing to be translated?

Machine language

To focus on the logic and make refinements to a program before translating it into a programming language, a programmer often creates an outline of the program's algorithm. What is the term for this type of outline?

Pseudocode

Which type of programming error causes a program to stop loading or executing?

Runtime

Amber is programming a robot with a color sensor to follow a black curvy line on a white floor. She has programmed the robot to move forward, curving to the left if it senses black on the floor, and curving right if it does not sense black. She is hoping this will allow the robot to follow the black line. Which type of control structure has Amber written?

Selection

Consider the following: 1. Input a color 2. Check to see if the color is red, green, or blue? a. If yes, write "Primary color for the RGB model." b. If no, write "Not a primary color for the RGB model." What type of control structure is this an example of?

Selection

Consider the following: 1. Input a number 2. Check to see if the number ends in 0, 2, 4, 6 or 8? a. If yes, write "The number is even." b. If no, write "The number is odd." This is an example of which type of control structure?

Selection

Jackson has written a section of code in his program that instructs a character to move forward unless it encounters an obstacle, such as a rock. If the character encounters an obstacle, then it should change direction before moving forward again. If it does not encounter an obstacle, it should continue moving forward. Which type of control structure has Jackson written?

Selection

Lucy is sharing her program with a student at another school. She is having a video conference with the student and shows a section of code that she is working on. Lucy describes it as the decision control structure. The other student is confused. What other name can this structure be called?

Selection

Which control structure will execute an instruction only after the computer evaluates conditions to determine if a certain condition exists?

Selection

Paige has coded the introduction for her new video game. The program is a set of codes that the computer follows one by one from top to bottom without player input. Which type of control structure is this?

Sequence

Which type of control structure includes a set of instructions that the computer follows one by one from top to bottom?

Sequence

Which type of programming structure requires each instruction to be performed in order, with no possibility of skipping an action or branching off to another action?

Sequence

What are the three main programming structures?

Sequence, selection, loop

Elsa is programming a robot to move from her front door to her room. The robot will not be remote controlled and does not have any sensors to "see" its environment. She must program the robot with clear movements that start at her front door, then move down the hall, then turn into her room and finally stop. Which term describes this program?

Sequential

Which term describes a set of instructions that lists steps that must be followed in a particular order, starting at the beginning and continuing to the end?

Sequential

Sharon's teacher has challenged her to create an algorithm that calculates the volume of a cube. Sharon presents the following algorithm: 1. Determine the length of one side of the cube. 2. Multiply the length of cube side by the length of cube side. 3. Multiply this result by the length of cube side. 4. The result is the volume of the cube. Which statement describes Sharon's work?

She should not change anything because the logic is correct.

Maryann is writing a set of instructions to determine whether a number is even or odd. She divided the problem into smaller, easier steps, as shown: 1. Input a number. 2. Check to see if the number ends in 0, 2, 4, 6 or 8? a. If yes, write "The number is even." b. If no, write "The number is odd." Which programming approach is Maryann using?

Structured

The robotics team has created a solid design that can physically accomplish all of their tasks for competition. Now they must create the program that will control the robot. The code could be massive, and be difficult for them to write and for the computer to execute. They decide to break problems into smaller, logical problems to make them easier to execute. Which type of programming is this?

Structured

Which type of programming is designed by breaking problems into smaller, logical problems to make them easier to execute?

Structured

Which type of error occurs when a programmer misspells a word or instruction?

Syntax

Zuri has tried to run her program, but an error has occurred. She looks closely at her code and realizes that there are several misspelled instructions. What type of error did Zuri's spelling mistakes create?

Syntax

Tori and her team have completed the initial programming for a new school lunch account tracking system. They have set up a "fake" school lunch line and are having several people input information in the system to see if there are any bugs in the program. Which problem-solving activity did the team complete with their "fake" cafeteria?

Test the plan.

How is structured programming similar to a recipe?

The steps must be performed in a certain order to produce the proper result.

Consider the following example algorithm: 1. Set members to 0 2. For each pair of members in the group, add two to members 3. Continue until all members in the group are counted 4. Display members Which scenario would cause an error in this algorithm?

Three members in the group

During testing, your development team identified some problems in the first program draft. What is the next step you need to complete?

Use logic to plan a solution.

Mr. Garcia taught Matilda the general problem solving steps to find solutions, and expects her to use them. Matilda has identified some problems in the first draft of her programming final project. What is the next step she would need to complete to find a solution?

Use logic to plan a solution.

Sylvia creates a program that asks and stores a user's name. It then displays the user's name every time there is a new prompt for the user to complete. What is used to store the name in the computer's memory that the computer can access and manipulate, when running Sylvia's program?

Variable

Consider the following pseudocode: Form a group of players in a room1. 1. Send one player out of the room - the 'it' player2. 2. Hide a button somewhere in the room3. 3. Instruct the 'it' player to return to the room and try to find the button 4. _____ the 'it' player looks for the button, 4a. If the 'it' player is near the button, all the remaining players should say "hot" 4b. If the 'it' player is far from the button, all the remaining players should say 'cold' 5. When the button is found, the 'it' player chooses another player to be 'it' 6. Repeat all steps until each player has a turn Notice the blank in Step 4 of the code. Which loop programming statement correctly completes the blank?

While

Computers organize the zeros and ones that represent an instruction into a series of eight pieces. This series of eight ones or zeros is known as:

a byte.

A set of instructions that tells a computer what to do to accomplish a particular task is called:

a computer program.

Julia has an idea. She wants to use a computer to create a list of daily "to-do" suggestions based on the previous activity on her calendar. To create this, she needs to develop a set of instructions to tell the computer what to-do to accomplish this task. This is known as:

a computer program.

You are designing a computer program that calculates the amount of change a customer should receive. You create a program design document using the following pseudocode to demonstrate the program flow: item1 = input cost of item 1 item2 = input cost of item 2 item3 = input cost of item 3 total = item1 + item2 + item3 amtPaid = input amount paid change = ________________ Notice the blank at the end of the program. Which expression correctly completes the blank?

amtPaid - total

Basic mathematics taught in elementary school is a base 10 number system (which makes it easy if you are using your fingers). Computers use a different number system, known as:

base 2

Charles is stuck. He knows that computers use zeros and ones in a sequence to represent data, but he cannot remember the name of this term. His teacher reminds him that it is referred to as:

binary.

Timson wants to create a loop control structure for a thermostat program. He wants the temperature to be set at 72 degrees Fahrenheit when the motion sensors in the building sense movement. What type of statement should be used for this loop?

do while

When a computer is performing the instructions contained in a program, it is called:

executing.

Matteo is programming a robot that will sort Legos by color. He plans to use the selection programming structure to separate the red Legos from all of the others. Which type of statement should he use?

if/else

Which type of statement is an example of a selection programming structure?

if/else

Anne decides to learn Javascript. This language translates a number of program instructions, waits for the computer to execute them and then translates the next series until the program is fully executed. To do this, it must use a(n):

interpreter

Consider the following code: turnRight (); for (var count = 0; count < 5; count++) { moveForward (); } The instruction code shown is an example of high-level:

programming language.

Consider this example code: if <this is true> do this else do something else The statements in the code show an example of:

pseudocode.

Horatio has an idea for the program he would like to use as his final project. Before he starts coding, he wants to write out the algorithm using short informal phrases to describe the program steps (such as Sales Tax= 0.006 or Output Results) to see how the code should be structured. This is known as:

pseudocode.

Using short informal phrases to describe program functions (such as "if total is more than 10, add discount") is called:

pseudocode.

Mrs. Kresowski is demonstrating a type of programming to her class. Her program requires only ten steps. She explains that every step must be followed in order and that no steps may be skipped. She shows the errors that will occur if the order is mixed or steps are skipped. This type of programming structure is known as:

sequence

Julia is asked to teach a new student about programming control structures. The first thing she does is explain that there are three main control structures, which are:

sequence, selection and loop.

Instructions (such as a recipe) are written so that each step is performed one at a time, from top to bottom, until the task is completed. This type of instruction process is called:

sequential.

Mario has begun learning a programming language. He thought that he would write the code in plain English. However, programming languages require that he learn and follow a special set of rules referred to as:

syntax.

The set of rules that must be followed when writing program instructions for a specific programming language is called:

syntax.

Aaron would like to create a program that allows the user to find the average of five numbers. He has asked for your help. Below is the pseudocode Aaron has written: Enter five numbers Add the numbers entered Multiply the sum of the numbers entered by 5 Display the result After examining the code, you determine that:

the program needs to divide the sum of the numbers entered by 5, not multiply.

Devising a plan to solve a problem or perform a task using a set of step-by-step instructions is called:

writing an algorithm.

Mrs. Bachand is teaching her students about programming code. On the first day she has the students write out the instructions on how they brush their teeth. She explains that making a plan to perform a task (or solve a problem) using a set of step-by-step instructions is called:

writing an algorithm.


Conjuntos de estudio relacionados

CISSP Definitions with Questions

View Set

Microeconomics Group Quiz--Chapter 4: 1st Quiz Given

View Set

economics chapter 5, economics chapter 7, economics chapter 8, economics chapter 10, economics chapter 11, economics chapter 12, economics chapter 13, economics chapter 15, economics chapter 16, economics chapter 1, economics chapter 2, economics cha...

View Set

Chapter 15: Management of Patients with Oncologic disorders

View Set