wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MIDTERM EXAM

Total questions: 18

Worksheet time: 10mins

Name
Class
Date
1.
  1. A set of rules that provide a way of telling a computer what operation to perform

a)

Algorithm

b)

Programming

c)
  1. Writing

d)
  1. Computer Program

2.

A way to give information to a computer that feeds data into a computer

a)

Computer

b)
  1. Program

c)

Input

d)
  1. Output

3.
  1. Often referred to as CODING

a)

Developing

b)
  1. Writing

c)

Programming

d)
  1. Testing

4.
  1. The result of your input

a)

Output

b)

Process

c)

Computer

d)
  1. Input

5.
  1. Another tool to describe the way to arrive at a solution expressed in a programming language, like constructs.

a)
  1. Algorithm

b)
  1. Source Code

c)
  1. Programming

d)

Pseudocode

6.
  1. A graphical representation of an algorithm or process that uses geometric symbols connected by arrows to show the direction of the flow of action,

a)
  1. Illustration

b)
  1. Pseudocode

c)

Flowchart

d)
  1. Data

7.
  1. What does the rectangle illustrate in a flowchart?

a)
  1. Start/ end points

b)

Process

c)
  1. Off-page connector

d)
  1. Input/ Output

8.
  1. Which one of the following is NOT a Java feature?

a)
  1. Object-oriented

b)

Use of pointers

c)
  1. Portable

d)
  1. Dynamic and Extensible

9.
  1. Which component is used to compile, debug, and execute the Java programs?

a)
  1. JRE

b)
  1. GIT

c)

JDK

d)
  1. JVM

10.
  1. Which statement is true about Java?

a)

Java is a sequence-dependent programming language

b)
  1. Java is a code dependent programming language

c)

Java is a platform-dependent programming language

d)

Java is a platform-independent programming language

11.

//Assignment statements

[ (a)   ] myInteger = 65+6;

12.

float myFloat = 4.02[ (a)   ];


13.

//Assignment statements

[ (a)   ] myChar = '1';

14.


//Assignment statements

[ (a)   ] myChars = "Character";


15.

//Print Statements

[ (a)   ].out.print("GOODLUCK!");


16.
  1. What are the four types of Java statements?

a)

Input Statement,

Output Statement,

Conditional Statement,

Looping Statement

b)

Print Statement,

Assignment Statement,

Variable Declaration,

Import Statement

c)

Function Statement,

Object Statement,

Loop Statement,

Class Statement

d)

Declaration Statement,

Expression Statement,

Control Flow Statement,

Block Statement

17.
  1. What will the error be in the following Java code?

byte b = 50;

b = b * 50;

a)
  1. b cannot contain value 50

b)
  1. b cannot contain value 100, limited by its range

c)
  1. There is no error in this code

d)

* operator has converted b 50 into int, which can not be converted to byte without casting

18.

What will be the output of the following Java program?

class VariableScope {

public static void main(String args[]) {

int x;

x = 5;{

int y = 6;

System.out.print(x + “ “ + y); }

System.out.println(x +” “ + y); }}

a)

Compilation error

b)
  1. Runtime error

c)
  1. 5 6 5 6

d)

5 6 5