wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SC025 Week 6

Total questions: 26

Worksheet time: 22mins

Name
Class
Date
1.

Which one of these is not a step in problem solving?

a)

Problem analysis

b)

Design a problem

c)

Documentation

d)

Implementation

2.

In object-oriented programming, what is meant by inheritance?

a)

wrapping code and data into a single unit.

b)

a single action can be performed in different ways.

c)

child object/class will acquire all states and behaviors of parent object/class

d)

hide the implementation details, shows only functionality

3.

Suggest the best control structure that can be used to solve the problem: Calculate the area of a school field

a)

Sequence

b)

Selection

c)

Repetition

4.

Suggest the best control structure that can be used to solve the problem: Calculate the total mark of 30 students

a)

Sequence

b)

Selection

c)

Repetition

5.

This is a valid assignment statement: 4.5 = weight;

a)

True

b)

False

6.

Which problem solving step does writing the source code in Java refer to?

a)

Design a solution

b)

Testing

c)

Problem analysis

d)

Implementation

7.

This is an invalid identifier: total$

a)

True

b)

False

8.

What is the answer for the following expression: int k= 5/2+12%2

a)

2

b)

2.5

c)

8

d)

0

9.

Identify the type of the following operator: <

a)

arithmetic

b)

relational

c)

logical

10.

What are the two tools used to describe algorithm?

a)

pseudocode, flowchart

b)

sequence, selection

c)

IPO analysis, pseudocode

d)

IPO analysis, flowchart

11.

identify the type of the following operator: %

a)

arithmetic

b)

relational

c)

logical

d)

modulus

12.

= is the operator used to assign value to a variable.

a)

True

b)

False

13.

Identify the type of the following operator: &&

a)

arithmetic

b)

relational

c)

logical

14.

Which one of these is the output statement?

a)

public static void main(String [] args)

b)

class Area{

c)

import java.util.Scanner;

d)

System.out.print(area);

15.

Identify the type of the following operator: !=

a)

arithmetic

b)

relational

c)

logical

d)

not equal

16.

Determine the value of x when it is printed/outputted: double x = (5+9) % 3 / 2;

a)

0

b)

1.0

c)

1

d)

0.0

17.

Assume a=35, b=79, evaluate the following Java statements: if (a==b)

a)

True

b)

False

18.

Choose the most suitable data type of the following data item: 35

a)

int

b)

double

c)

char

d)

boolen

19.

Assume a = 35, b=79. Evaluate the following java statements: while (a!=b)

a)

True

b)

False

20.

Choose the suitable data type for the following data item: cabinet's member weight

a)

int

b)

double

c)

char

d)

boolean

21.

Is the following identifier valid or invalid? 2names

a)

valid

b)

invalid

22.

Choose the most suitable data type for the following data item: 'z'

a)

int

b)

double

c)

char

d)

boolean

23.

Assume a=35, b=79. Evaluate the following Java statements: if (a<15)

a)

True

b)

False

24.

Choose the most suitable data type for the following data item: area of triangle

a)

int

b)

double

c)

char

d)

boolean

25.

Compute the value of the following Java expression: 5*6+3*2

a)

66

b)

36

c)

80

26.

What is the output of the following code segment:

int a=8;

a=a+1;

System.out.print(a);

a)

8

b)

9

c)

error