wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

capati roti canai

Total questions: 22

Worksheet time: 11mins

Name
Class
Date
1.

A PROGRAM is a series of _____________ for a computer or device to follow

a)

instructions

b)

windows

c)

suggestions

d)

voices

2.

Which of these would create a loop?

a)
b)
c)
3.

This type of algorithm involves instructions done one after another.

a)

Sequence

b)

Selection

c)

Iteration/Looping

4.

This type of algorithm involves repeating instructions.

a)

Sequence

b)

Selection

c)

Iteration/Looping

5.
How many types of Selection statements are there?
a)
3
b)
1
c)
2
d)
4
6.
Which one of the following is not basic programming construct?
a)
Loop 
b)
Sequence 
c)
Iteration 
d)
Selection
7.
What is an algorithm?
a)
A series of steps that can be followed to complete a task  
b)
A type of sort 
c)
A type of iteration  
d)
A selection  
8.

This type of algorithm involves asking a question and a choice is made.

a)

Sequence

b)

Selection

c)

Iteration/Looping

9.

What is a set of instructions that a computer uses to solve a problem?

a)

Algorithm

b)

Processing

c)

Storage

d)

Output

10.

What is a computer programming?

a)

A list of step-by-step instrution to tell the computers what to do

b)

A set of guidelines that describes how to perform certain tasks

c)

A step-by-step process that needs be followed logically to complete a task

11.

Which of the following is NOT the function of computer programming?

a)

Building games

b)

Making new software

c)

Creating an app or a website

d)

Hacking people's account

12.

The if -else statement executes a block of code if a specified condition is

a)

true

b)

false

c)

both

d)

none

13.

Which of the following is a conditional statement?

a)

if

b)

if else

c)

if else if

d)

all of the above

14.

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)?

a)

Equilateral triangle

b)

Scalene triangle

c)

Isosceles triangle

d)

All of the above

15.

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")

}

a)

Hello World

b)

Hello World

Error

c)

Error

d)

Hello world

16.

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");

}

a)

Error

b)

Incorrect code

c)

x is greater than y

d)

Error

Incorrect code

17.

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?

a)

It is too hot

b)

It is pleasant

c)

It is hot but not too much

d)

runtime error

18.
  1. Advantages of using the method.

a)
  • Code reusability

b)

Easier to debug

c)

to complicate the solution

d)
  • to organize and simplify coding.

19.

When you get to a computer program and repeat a command, you can give it an exact number of times to

a)

repeat

b)

end

20.

When you define your own command and give it a command

a)

instruction

b)

loop

c)

function

d)

code

21.

Most computer languages have only about ___ words or commands

a)

100

b)

50

c)

1,000

d)

20

22.

An If/Else statement is

a)

a command that tells the computer to repeat an action

b)

a normal computer function

c)

a decision between 2 things