Font size
WorksheetsCSEC IT - 04 Loops & Trace Tables
Total questions: 50
Worksheet time: 42mins
Who might use a Trace-table?
A computer programmer
IT Technician
Hardware engineer
An artist
What is the purpose of using a Trace table?
Planning before writing a program
To help debug a program
Check for spelling mistakes
Understand the program more
In your trace table, you need a column for each v (a) , and a column for your output.
The trace table will contain two columns: (a) and Output.
The trace table will contain three columns: n, (a) , and Output.
This loop will repeat (a) times
What are logic errors?
An error that does not stop the code from executing
When the logic gates are incorrectly connected
An error where the logic doesn't make sense
Code that does not give the desired output
Syntax error, Logic error or this code is perfect?
Another great program, it is all ok
Syntax error
Logic error
Which loop loops a set number of times?
for
while
infinite
loopy
Repeating a task multiple times in programming is known as ?
Iterators
Scope
Looping
In programming, what is iteration?
The repetition of steps within a program
The order in which instructions are carried out
A decision point in a program
Testing a program to make sure it works
FOR loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
Which type of loop iterates until instructed otherwise?
FOR loop
WHILE loop
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'A' be?
1
3
5
7
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'B' be?
1
3
5
7
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'C' be?
1
3
8
13
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'D' be?
11
13
8
1
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'E' be?
3
5
8
13
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'F' be?
5
8
13
18
How many times will the following code print "Welcome to LIFE"?
int count = 0;
while (count < 10)
{ System.out.println("Welcome to LIFE"); count++; }
0
8
9
10
Which of these is the correct syntax for a loop?
fore(integer i = 0; i>10; i++){}
for(int i = 0; i<10; 1++){}
for(int i = 0; i<10){}
for(int i){}
Which of the following is the correct way to create a String?
String s = "I am cool";
string string = i am cool;
String s = I am cool
String s = "I" am cool;
What kind of construct is this?
A count-controlled loop
A condition controlled loop
An infinite loop
A decision
What type of error is a bug in a program that causes it to operate incorrectly, but not to terminate or crash?
Runtime errors
Syntax errors
Logic errors
Memory errors
What type of errors are mistakes in the way that the code is written?
Runtime errors
Syntax errors
Logic errors
Memory errors
_______ operators are used to compare two values of the same type.
Arithmetic
Relational
Logical
Control
A data value that does not change during the execution of a program is _____.
Variable
Constant
Character
Number
It is possible to add maths into Scratch, what is the Scratch Key Word used for it?
Operators
Calculators
Calculations
Operations
_____________________ allows the computer to make a choice between alternative conditions.
control structure
sequence structure
selection structure
iteration structure
Which of the following mean greater than or equal to?
=<
<=
=>
>=
Select all logical operators listed
!=
==
AND
OR
In the expression
A * B + ( C + D ) , what is computed first?
A * B
( C + D )
B + ( C + D )
None of the above
Select ALL the relational operators
>
<
%
!=
Which of the following means NOT equal to. Select ALL
<>
<<
!=
>>
In order to control the program flow and to make decisions, we need to use the conditional operators and the logical operators together with the If...Then...Else control structure.
True
False
Conditional Operators are also known as numerical comparison operators.
True
False
The comparison in Conditional Operators will return a true or maybe result.
True
False
Logical Operator And : One side or other must be true
True
False
Logical Operator Or : Both sides must be true
True
False
There are basically three types of If control structures.
True
False
This is the simplest control structure which instructs the computer to perform a certain action specified by the Visual Basic 2013 expression if the condition is true.
If Then Statement
If Then Else Statement
If Then ElseIf Statement
This control structure will ask the computer to perform a certain action specified by the Visual Basic 2013 expression if the condition is met. And when the condition is false, an alternative action will be executed.
If Then Statement
If Then Else Statement
If Then ElseIf Statement
If there are more than two alternative choices, using just If…Then…Else statement will not be enough.
In order to provide more choices, we can use:
If Then Statement
If Then Else Statement
If Then ElseIf Statement
These type of devices make all the decisions in an electronic system.
Input
Process
Output
These type of devices receive and external signal.
Input
Process
Output
LEDs and lamps are examples of what type of device?
Input
Process
Output
