Sample Paper Class 8 Computer
Sample Paper Class 8 Computer
INTERNATIONAL SCHOOL
Sample Paper
Name: Subject: Computer
Class: VIII Date:
General Instructions:
All questions are compulsory.
All questions must be attempted in the correct order.
Hand writing must be neat and legible.
ii. Which of these statements has one condition and two outcomes?
a. if statement b. if...else...if statement
c. Nested if statement d. if…else statement
v. A spanning tree with n vertices will always have how many edges?
a. n b. n-1 c. n+1 d. 2n-2
vii. A function satisfies f(0) = 3, f(1) = 6, f(2) = 9, f(3) = 12. What is the correct function?
a. f(x) = x2 b. f(x) = 3x c. f(x) = x+3 d. f(x) = 3x+3
viii. Which step ensures that the function is adjusted based on new information in an iterative process?
a. Execution b. Validation c. Refinement d. Compilation
x. If a list contains n elements, how many passes does the selection sort algorithm require?
a. n b. n-1 c. n/2 d. 2n
3. Write T for True and F for False for the given statements: (10 x ½ = 5)
a. + operator can also join two numeric values.
b. There are three types of control statements in Javascript.
c. Looping means to repeat the statements multiple times till the condition is true.
d. <script> tag cannot be placed inside the <head> tag.
e. The selection sort algorithm works by comparing and swapping adjacent elements.
f. Selection sort is an unstable sorting algorithm.
g. Validation is the process of checking whether a function satisfies given conditions.
h. The first step in defining a function is iteration.
i. A spanning tree of a connected graph always contains the same number of edges as the original graph.
j. The formula for the number of spanning trees in a clique is n (n – 2).
7. Write a JavaScript program to print first ten natural numbers using while loop. (5 x 1 = 5)