0% found this document useful (0 votes)
26 views

2024 Term 1 Comp

Uploaded by

Angelina George
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

2024 Term 1 Comp

Uploaded by

Angelina George
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Term I Exam/Midterm exam

2022-23

Grade: X Subject: Computer Applications Marks: 100

Time: 2 hrs

General Instructions:

The first 15 minutes should be spent in reading the question paper. And you will not be
allowed to write during the first 15 minutes.
● The time given at the head of this Paper is the time allowed for writing the answers
● Section A is compulsory.
● Attempt any four questions from Section B.
● The intended marks for questions or parts of questions are given in brackets [ ].
● This Question paper contains _8___ printed pages

SECTION A

(Attempt ALL questions from this section)

(40 marks)

Question 1

Select the correct answer to the questions from the given options (Do not copy the
question. Write correct answer only): [20x1=20 Marks]

(i) Automatic conversion of primitive data into an object of wrapper class is called:

a) Auto boxing
b) Un boxing
c) shifting
d) none

(ii) The process by which a class acquires the properties from another class is called:

(a) Polymorphism
(b) Encapsulation
(c) Inheritance

Term I Exam / Midterm Exam 2022-23/ 1 of 8


(d) Data abstraction

(iii) Java Virtual Machine (JVM) is an:

(a) Compiler
(b) Interpreter
(c) Editor
(d) Debugger

(iv) The output of Math.cbrt(-3) will be -27.

(a) true
(b) false
(v) Which of the following packages contain String functions?

(a) Java.Lang
(b) Java.awt
(c) Java.Stirng
(d) java.lang

(vi) Which of the following functions is used to remove the leading and trailing spaces from the
string?

(a) truncate()
(b) trail()
(c) trim()
(d) slice()

(vii) Indicate the error message which displays ,if the following statement is executed:

int a[]={28,32,45,68,12};

System.out.prinln(a[5]);

(a) Insufficient cells


(b) Array index out of bounce
(c) Elements exceeding the cells
(d) 12
(viii) A dimensional array is also called

(a) Subscripted variable


(b) subscript

Term I Exam / Midterm Exam 2022-23/ 2 of 8


(c) indexed value
(d) compound variable

(ix) Which of the following keywords is used to create an instance of class?

(a) public
(b) object
(c) main
(d) new

(x) Which of the following is non numeric data type?

(a) boolean
(b) byte
(c) short
(d) long

(xi) Which of the following is the correct usage?

(a) int a[-40]


(b) int a[40]
(c) float a[0-40]
(d) none

(xii) Which of the following is the correct order of the data types in ascending order based on
their memory allocations?

(a) boolean,short,float,byte
(b) byte,boolean,short,float
(c) boolean,byte,short,float
(d) float,short,boolean,byte

(xiii) Choose the odd one out from the following:

(a) >
(b) &&
(c) ==
(d) <=

Term I Exam / Midterm Exam 2022-23/ 3 of 8


(xiv) Which of the following method will accept a string by using Scanner object?

(a) next()
(b) next.String()
(c) nextLine()
(d) both a & C

(xv) Given : double b=Math.ceil(-3.4)+Math.pow(2,3); What will be the final value stored in the
variable b?

(a) 4
(b) 4.0
(c) 5.0
(d) 5

(xvi) If (p>q) && (q>r)) then.

(a) q is the smallest number


(b) q is the greatest number
(c) p is the greatest number
(d) none
(xvii) ____ will terminate the loop without its completion.

(a) System.exit(0);
(b) end

(c) continue

(d) break

(xviii) ____ function will convert String to primitive data type.

(a) parseint()
(b) parseString()

(c) valueOf()

(d) none

Term I Exam / Midterm Exam 2022-23/ 4 of 8


(xix) Which of the following function will join two Strings?

(a) merge();
(b) join()

(c) connect()

(d) concat()

(xx) . Choose the odd one out from the following:

(a) array;
(b) String

(c) class

(d) int

Question 2 :
Answer the following: [ 10*2=20 Marks]
i. What is the value of y after the execution?
y+= ++y + y-- + --y; when int y=8:

ii. Rewrite the below code using ternary operator.


if(a > b)
{
if (a > c)
g = a;
else
g = c;
}
else if (b > c)
g = b;
else
g = c;
iii. Predict the output of the following
System.out.println(Math.ceil(-6.4)+Math.pow(2,5)+Math.round(-9.5));

Term I Exam / Midterm Exam 2022-23/ 5 of 8


iv. What will be the output of the program segment and how many times the loop runs?

int k=1,i=2;
while(++i<6)
k*=i;
System.out.println(k);

v. What will be the output of the program segment and how many times the loop runs?

int i;
for(i = 5; i > 10; i++)
System.out.println(i);
System.out.println(i * 4);

vi. int a=1,b=2,c=3;


switch(p)
{
case 1: a++;
case 2: ++b;
break;
case 3: c--;
}
System.out.println(a + ","
+ b + "," +c);
(i) when p = 1,what is the output?

vii. Give the output of the following string functions:

(i) "ACHIEVEMENT".replace('E', 'A')


(ii) ii) "DEDICATE".compareTo("DEVOTE")

viii. Write a statement for each to perform the following task on a string:

(i) Extract the second last character of a word stored in the variable wd.

(ii) Check if the second character of a string str is in upper case.

Term I Exam / Midterm Exam 2022-23/ 6 of 8


ix.
int a[ ]={2,4,6,8};
for(i=0;i<=1;i++)
{
s=a[i]+a[3-i];
System.out.println(s);
}
x. Write the Java expression for the following:
−𝑏+√𝑏2 −4𝑎𝑐
𝑥=
2𝑎

Section B (60 Marks)

Attempt any four questions from this section [4*15=60]

Each program should be written using three comments and variable description

Question 3:
Write a menu driven program to check whether the given number
is i) Neon Number ( A number is said to be ‘Neon’ if sum of the digits of
the square of the number is equal to the number itself. eg 9 is a Neon number).
ii) Perfect Number ( A number is said to be ‘Perfect’ if sum of the
factors,( excluding the number itself) is same as the original number.
eg. 6 is a Perfect number) [15]

Question 4:
Write a program to store 10 students and their phone numbers in two single dimensional
arrays. Enter a name separately and search it in the given list of names. If it is present then
display the name with its telephone number otherwise, display a message “Name not found”.
Use linear search technique. [15]

Question 5:
Write a program in Java to input a sentence. Count and display the frequency of each letter
of the sentence in alphabetical order. [15]

Term I Exam / Midterm Exam 2022-23/ 7 of 8


Question 6:
Write a program to accept the year of graduation from school as an integer value from the
user. Using the binary search technique on the sorted array of integers given below, output
the message "Record exists" if the value input is located in the array. If not, output the
message "Record does not exist".
Sample Input:
n[0] n[1] n[2] n[3] n[4] n[5] n[6] n[7] n[8] n[9]
1982 1987 1993 1996 1999 2003 2006 2007 2009 2010
Input-2003
Output: 2003 found at index 5(Ascending order Binary search)

Question 6:
Write a program to accept a word and convert it into lower case, if it is in upper case. Display
the new word by replacing only the vowels with the letter following it.
SampleInput:computer
Sample Output: cpmpvtfr

Question 7:
Write a program to accept a list of 20 integers. Sort the first 10 numbers in ascending order
and next the 10 numbers in descending order by using 'Bubble Sort' technique. Finally, print
the complete list of integers.

******************* ALL THE BEST *******************

Term I Exam / Midterm Exam 2022-23/ 8 of 8

You might also like