WorksheetsMIDTERM EXAM
Total questions: 18
Worksheet time: 10mins
A set of rules that provide a way of telling a computer what operation to perform
Algorithm
Programming
Writing
Computer Program
A way to give information to a computer that feeds data into a computer
Computer
Program
Input
Output
Often referred to as CODING
Developing
Writing
Programming
Testing
The result of your input
Output
Process
Computer
Input
Another tool to describe the way to arrive at a solution expressed in a programming language, like constructs.
Algorithm
Source Code
Programming
Pseudocode
A graphical representation of an algorithm or process that uses geometric symbols connected by arrows to show the direction of the flow of action,
Illustration
Pseudocode
Flowchart
Data
What does the rectangle illustrate in a flowchart?
Start/ end points
Process
Off-page connector
Input/ Output
Which one of the following is NOT a Java feature?
Object-oriented
Use of pointers
Portable
Dynamic and Extensible
Which component is used to compile, debug, and execute the Java programs?
JRE
GIT
JDK
JVM
Which statement is true about Java?
Java is a sequence-dependent programming language
Java is a code dependent programming language
Java is a platform-dependent programming language
Java is a platform-independent programming language
//Assignment statements
[ (a) ] myInteger = 65+6;
float myFloat = 4.02[ (a) ];
//Assignment statements
[ (a) ] myChar = '1';
//Assignment statements
[ (a) ] myChars = "Character";
//Print Statements
[ (a) ].out.print("GOODLUCK!");
What are the four types of Java statements?
Input Statement,
Output Statement,
Conditional Statement,
Looping Statement
Print Statement,
Assignment Statement,
Variable Declaration,
Import Statement
Function Statement,
Object Statement,
Loop Statement,
Class Statement
Declaration Statement,
Expression Statement,
Control Flow Statement,
Block Statement
What will the error be in the following Java code?
byte b = 50;
b = b * 50;
b cannot contain value 50
b cannot contain value 100, limited by its range
There is no error in this code
* operator has converted b 50 into int, which can not be converted to byte without casting
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); }}
Compilation error
Runtime error
5 6 5 6
5 6 5
