Font size
Worksheetscapati roti canai
Total questions: 22
Worksheet time: 11mins
A PROGRAM is a series of _____________ for a computer or device to follow
instructions
windows
suggestions
voices
Which of these would create a loop?
This type of algorithm involves instructions done one after another.
Sequence
Selection
Iteration/Looping
This type of algorithm involves repeating instructions.
Sequence
Selection
Iteration/Looping
This type of algorithm involves asking a question and a choice is made.
Sequence
Selection
Iteration/Looping
What is a set of instructions that a computer uses to solve a problem?
Algorithm
Processing
Storage
Output
What is a computer programming?
A list of step-by-step instrution to tell the computers what to do
A set of guidelines that describes how to perform certain tasks
A step-by-step process that needs be followed logically to complete a task
Which of the following is NOT the function of computer programming?
Building games
Making new software
Creating an app or a website
Hacking people's account
The if -else statement executes a block of code if a specified condition is
true
false
both
none
Which of the following is a conditional statement?
if
if else
if else if
all of the above
If a, b and c are the sides of a triangle then which of the following statement is true for:
if(a==b && a==c && b==c)?
Equilateral triangle
Scalene triangle
Isosceles triangle
All of the above
PREDICT THE OUTPUT:
int x = 60;
int y = 90;
if (y%x == 0 && y-x==30)
{
System.out.println("Hello World");
}
else
{
System.out.println("Error")
}
Hello World
Hello World
Error
Error
Hello world
PREDICT THE OUTPUT:
int x = 20;
int y = 18;
if(x>y)
System.out.println("x is greater than y");
else
{
System.out.println("Error");
System.out.println("Incorrect code");
}
Error
Incorrect code
x is greater than y
Error
Incorrect code
public void main()
{
double temp = 56.0;
if (temp <=54.0 && temp>40)
System.out.println(“It is too hot”);
else if ( temp<40 || temp>30)
System.out.println(“It is hot but not too much”);
else
System.out.println(“It is pleasant”);
}
What will be the output?
It is too hot
It is pleasant
It is hot but not too much
runtime error
Advantages of using the method.
Code reusability
Easier to debug
to complicate the solution
to organize and simplify coding.
When you get to a computer program and repeat a command, you can give it an exact number of times to
repeat
end
When you define your own command and give it a command
instruction
loop
function
code
Most computer languages have only about ___ words or commands
100
50
1,000
20
An If/Else statement is
a command that tells the computer to repeat an action
a normal computer function
a decision between 2 things
