wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Fundamentals of programming Quiz

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

What is a flowchart?

a)

A graphical representation of a process

b)

A type of programming language

c)

A text-based description of a process

d)

A software application

2.

Which symbol is used to represent the start or end of a flowchart?

a)

Rectangle

b)

Oval

c)

Diamond

d)

Parallelogram

3.

Which flowchart symbol represents a decision point?

a)

Rectangle

b)

Oval

c)

Diamond

d)

Parallelogram

4.

In a flowchart, what does an arrow represent?

a)

Start of a process

b)

End of a process

c)

Direction of flow

d)

Input or output

5.

Which of the following best describes 'input' in the input, processing, and output cycle?

a)

Data that is processed

b)

Data that is stored

c)

Data that is retrieved

d)

Data that is entered into the system

6.

What is the main function of the 'processing' step in the input, processing, and output cycle?

a)

To store data

b)

To display data

c)

To create another data

d)

To transform input data into information

7.

What is the purpose of the 'output' step in the input, processing, and output cycle?

a)

To enter data into the system

b)

To transform data

c)

To store data

d)

To display or present the processed data

8.

What is an algorithm?

a)

A programming language

b)

A type of flowchart

c)

A hardware component

d)

A step-by-step procedure for solving a problem

9.

What is a 'sequence' in program logic?

a)

A block of code that executes only once

b)

A block of code that repeats

c)

A block of code that makes a decision

d)

A block of code that executes in order

10.

Which of the following is a valid declaration of a variable in Java?

a)

int 2x = 10;

b)

float y = 5.5f;

c)

boolean var = "true";

d)

char ch = "c";

11.

Which data type is used to store a single character in Java?

a)

String

b)

char

c)

boolean

d)

int

12.

What is the output of the following code?

System.out.println(10 / 3);

a)

3.3333

b)

3

c)

3.0

d)

error

13.

What is the result of the following code?

String s = "hello";

System.out.println(s.length());

a)

5

b)

6

c)

4

d)

error

14.

What does the following statement represent in Java?

int a, b = 10, c;

a)

Only b is initialized

b)

All variables are initialized

c)

a and c are initialized to 0

d)

Syntax error

15.

What will be the result of the following expression?

int result = 10 % 3;

a)

1

b)

0

c)

3

d)

10

16.

1.        What will be the result of the following expression?

int result = (5+2*2+10/2);

a)

10

b)

14

c)

12

d)

19

17.

Which of the following is not a valid Java datatype?

a)

byte

b)

short

c)

real

d)

long

18.

What will be the output of the following code?

int x = 5;

x++;

System.out.println(x);

a)

6

b)

5

c)

7

d)

error

19.

How do you declare a constant in Java?

a)

int const PI = 3.14;

b)

final int PI = 3;

c)

constant int PI = 3;

d)

int final PI = 3;

20.

What will be the output of the following code?

int a = 10;

int b = 5;

System.out.println(a += b);

a)

5

b)

10

c)

15

d)

error

21.

Which operator is used to compare the equality of two values in Java?

a)

=

b)

==

c)

!=

d)

&&

22.

What will be the output of the following code?

System.out.println(2 + "3");

a)

23

b)

5

c)

0

d)

error

23.

Which scanner class method reads an integer input?

a)
  • nextInt()

b)
  • next()

c)
  • parseInt()

d)
  • nextLine()

24.

Which of the following methods reads a full line of string?

a)

nextInt()

b)

nextLine()

c)

nextLong()

d)

next()

25.

Which method reads a floating-point number storing up to 15 decimal digits from the input?

a)

nextDouble()

b)

nextInt()

c)

nextFloat()

d)

nextBoolean()