0% found this document useful (0 votes)
202 views5 pages

Grade VIII ICT Final Java Sample Paper

This document contains a sample exam paper for Class VIII students taking an ICT subject exam. The paper contains 5 questions testing students' knowledge of Java programming concepts like loops, variables, data types, object-oriented programming principles, and writing basic Java code. The questions are a mix of fill-in-the-blank, multiple choice, true/false, and writing code. The paper provides instructions, allocates marks to each question, and gives examples of code snippets to analyze and reproduce.

Uploaded by

aanyabothra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
202 views5 pages

Grade VIII ICT Final Java Sample Paper

This document contains a sample exam paper for Class VIII students taking an ICT subject exam. The paper contains 5 questions testing students' knowledge of Java programming concepts like loops, variables, data types, object-oriented programming principles, and writing basic Java code. The questions are a mix of fill-in-the-blank, multiple choice, true/false, and writing code. The paper provides instructions, allocates marks to each question, and gives examples of code snippets to analyze and reproduce.

Uploaded by

aanyabothra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Scottish High International School

Final Term Examination (2023-2024) – Sample Paper


CLASS VIII
SUBJECT: ICT

MAX. MARKS: 20 TIME: 45 MINUTES


NAME: ________________ ROLL NO._______
CLASS: ________________ SECTION:_______

General instructions:
1. Read the questions carefully.
2. All the questions are compulsory.

Q1. Fill in the blanks [10 x 0.5 = 5]

(a) The '%' operator is used to find the _____ of two numbers in Java.

(b) The '++' operator is used for _____ by 1 in Java.

(c) The ‘if’ control structure allows you to execute a block of code only if a _____ is true.

(d) Each case in a switch statement is followed by a _____ statement.

(e) In the ‘for’ loop syntax, each part is separated by _____.

(f) A ________________________ is a named location in the memory, which stores data temporarily.

(g) The ________________________ works on a single variable or constant.

(h) A Java program is compiled into an intermediate language called __________________________.

(i) The full form of JVM is _______________________________________________

(j) A_______________ loop is a sequence of instructions which is repeated until the specified condition is

met.

Q2. Multiple choice Questions [10 x 0.5 = 5]

(i). Which of the following is not a type of loop in Java?


(a) for
(b) while
(c) repeat
(d) do-while

(ii). Which of the following is used to store whole numbers in Java?


(a) string
(b) int
(c) double
(d) boolean

(iii). What keyword is used to define a class in Java?


(a) class
(b) object
(c) create
(d) function

(iv). What does OOP stand for?


(a) Object-Oriented Programming
(b) Operational Optimization Process
(c) Object-Oriented Processing
(d) Operation-Oriented Programming

(v). What is inheritance in OOP?


(a) Creating multiple methods with the same name
(b) Copying data from one object to another
(c) Creating new classes from existing ones
(d) Hiding the implementation details of a class

(vi). What is a class in OOP?


(a) A blueprint for creating objects
(b) A type of loop
(c) A method in Java
(d) A conditional statement

(vii). What are tokens in Java?


(a) Words and symbols that make up a program
(b) Data types used in a program
(c) Algorithms used for sorting
(d) Instructions for executing a program

(viii). What is an object in programming?


(a) A collection of data and functions
(b) A type of loop
(c) A keyword in Java
(d) A mathematical equation

(ix). What is the purpose of a variable in programming?


(a) To store data that does not change
(b) To store data that can change during program execution
(c) To perform mathematical calculations
(d) To create loops in the program

(x). In Java, identifiers are used to ____________________.


(a) Define mathematical equations
(b) Declare variables, functions, classes, etc.
(c) Create loops
(d) Perform decision making

Q3. State True or False and correct the false statement in the next line. [10 x .5 = 5]

(i). In object-oriented programming, objects are created before classes. ___________

________________________________________________________________________________

(ii). Constants are used to store data that remains same throughout the program. ___________

________________________________________________________________________________

(iii). Constants are also referred as Literals. ___________

________________________________________________________________________________

(iv). An identifier should not be a Java keyword ___________

________________________________________________________________________________

(v). The 'void' keyword in Java is used to specify that a method does not return any value. ___________

________________________________________________________________________________

(vi). The 'new' keyword in Java is used to create objects. ___________

________________________________________________________________________________

(vii). Every statement in java ends with a ‘.’ (full stop). ___________

________________________________________________________________________________
(viii). The command line ‘String Args’ can be used in both the ways: String[] args

and String args[] ___________

________________________________________________________________________________

(ix). An ‘if’ statement must always be followed by an else block in Java. ___________

________________________________________________________________________________

(x). The default case in a switch statement is mandatory in Java. ___________

________________________________________________________________________________

Q4. Write the code in Java for the following statements: (Any three) [3 x 1 = 3]

(i). Declare a float variable ‘i’ to store value 643.

________________________________________________________________________________

(ii). Apply the condition to check whether the product of ‘a’ and ‘b’ variables is more than the variable

‘n’.

_______________________________________________________________________________

(iii). Check whether a variable x is divisible by 3

________________________________________________________________________________

(iv). Use ‘for’ loop statement to display the output of numbers 10-1 in a single line.

________________________________________________________________________________

(v). Print the message ‘Hello world!’ on the screen.

________________________________________________________________________________

Q5. Display the exact output of the following programs: [2 x 1 = 2]

(i). class program_1


{
public static void main(String[] args)
{
int a, ans =0;
for(a=1; a<=10; a++)
{
ans = a* a;
System.out.println(a + “ : ” + ans );
}
}
}
(ii). class program_2
{
public static void main(String[] args)
{
int a=2;
switch(a)
{
case 1:
System.out.println(“January”);
break;
case 2:
System.out.println(“Feb”);
case 3:
System.out.println(“March”);
case 4:
System.out.println(“April”);
break;
default:
System.out.println(“Wrong Choice!”);
}
}
}

Output – Program 1 Output – Program 2

******************************************************************************************

You might also like