NEW
Font size
WorksheetsFundamentals of programming Quiz
Total questions: 25
Worksheet time: 13mins
What is a flowchart?
A graphical representation of a process
A type of programming language
A text-based description of a process
A software application
Which symbol is used to represent the start or end of a flowchart?
Rectangle
Oval
Diamond
Parallelogram
Which flowchart symbol represents a decision point?
Rectangle
Oval
Diamond
Parallelogram
In a flowchart, what does an arrow represent?
Start of a process
End of a process
Direction of flow
Input or output
Which of the following best describes 'input' in the input, processing, and output cycle?
Data that is processed
Data that is stored
Data that is retrieved
Data that is entered into the system
What is the main function of the 'processing' step in the input, processing, and output cycle?
To store data
To display data
To create another data
To transform input data into information
What is the purpose of the 'output' step in the input, processing, and output cycle?
To enter data into the system
To transform data
To store data
To display or present the processed data
What is an algorithm?
A programming language
A type of flowchart
A hardware component
A step-by-step procedure for solving a problem
What is a 'sequence' in program logic?
A block of code that executes only once
A block of code that repeats
A block of code that makes a decision
A block of code that executes in order
Which of the following is a valid declaration of a variable in Java?
int 2x = 10;
float y = 5.5f;
boolean var = "true";
char ch = "c";
Which data type is used to store a single character in Java?
String
char
boolean
int
What is the output of the following code?
System.out.println(10 / 3);
3.3333
3
3.0
error
What is the result of the following code?
String s = "hello";
System.out.println(s.length());
5
6
4
error
What does the following statement represent in Java?
int a, b = 10, c;
Only b is initialized
All variables are initialized
a and c are initialized to 0
Syntax error
What will be the result of the following expression?
int result = 10 % 3;
1
0
3
10
1. What will be the result of the following expression?
int result = (5+2*2+10/2);
10
14
12
19
Which of the following is not a valid Java datatype?
byte
short
real
long
What will be the output of the following code?
int x = 5;
x++;
System.out.println(x);
6
5
7
error
How do you declare a constant in Java?
int const PI = 3.14;
final int PI = 3;
constant int PI = 3;
int final PI = 3;
What will be the output of the following code?
int a = 10;
int b = 5;
System.out.println(a += b);
5
10
15
error
Which operator is used to compare the equality of two values in Java?
=
==
!=
&&
What will be the output of the following code?
System.out.println(2 + "3");
23
5
0
error
Which scanner class method reads an integer input?
nextInt()
next()
parseInt()
nextLine()
Which of the following methods reads a full line of string?
nextInt()
nextLine()
nextLong()
next()
Which method reads a floating-point number storing up to 15 decimal digits from the input?
nextDouble()
nextInt()
nextFloat()
nextBoolean()
