0% found this document useful (0 votes)
60 views8 pages

10th 1st Term Paper 2023-24

Uploaded by

Mandadi Jyoshna
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)
60 views8 pages

10th 1st Term Paper 2023-24

Uploaded by

Mandadi Jyoshna
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/ 8

NIRAJ PUBLIC SCHOOL

ST
1 TERM EXAMINATION –SEPTEMBER 2023-24
COMPUTER APPLICATIONS
CLASS: 10
TIME: 2 hrs. MARKS: 100

Answers to this paper must be written on the paper provided separately.


You will NOT be allowed to write during the first 15 minutes.
This time is to be spent in reading the question paper only.
Answer ALL questions from SECTION–A and any FOUR questions from
SECTION – B.
The intended marks for questions or parts of questions are given in brackets [
].
SECTION A (40 marks)
Attempt all questions from this section

QUESTION NO 1:- [20]


Choose the correct answer and write the correct option:

(i) Which of the following best defines a class?


(a) Parent of an object
(b) Instance of an object
(c) Blueprint of an object
(d) Scope of an object

(ii) A data type that contains integer as well as fractional parts and
occupies 32 bits
space is:
(a) float
(b) char
(c) double
(d) byte

(iii) Write the output:


System.out.println(Math.floor(-11.51)));
System.out.println(Math.pow(3, 4)));
(a) -12.0
81
(b) -12.0
81.0
(c) -11.0
12.0
(d) -11.0
81.0

(iv) A java expression that contains all the elements of same data type
is _____________ expression.
(a) Simple
(b) Complex
(c) Pure
(d) Mixed

(v) Arrange the following primitive data types in ascending order of


their size:
double, int, byte, char
(a) int, byte, char, double
(b) byte, char, int, double
(c) char, byte, int, double
(d) double, int, char, byte

(vi) Rewrite the following using the ternary operator.


if(bill>10000)
discount=bill*10.0/100;
else
discount= bill*5.0/100;

(a) bill>10000 ? discount=bill*10.0/100 : bill*5.0/100.0;


(b) discount = bill>10000 : bill*10.0/100 ? bill*5.0/100.0;
(c) discount = bill>10000 ? bill*10.0/100 : bill*5.0/100.0;
(d) bill>10000 : discount=bill*10.0/100 ? bill*5.0/100.0;

(vii) Write the output:


int a=3, b=4;
a*= ++a/6 + b++ % 3 + b;
System.out.println(a);

(a) 18
(b) 15
(c) 30
(d) 24

(viii) The access modifier that gives the most accessibility is:
(a) private
(b) public
(c) protected
(d) package
(ix) When the operators have the same priority, they are evaluated
from …………….. …………. in the order they appear in the
expression.
(a) right to left
(b) left to right
(c) any of the order
(d) depends on the compiler

(x) What type of conversion is happening in the following statement:


double d = 3.2f;
(a) explicit
(b) implicit
(c) default
(d) simple

(xi) What is the output for:


System.out.print(“Malayalam”.replace(‘a’,’z’).substring(3,6));
(a) Mzlzyzlzm
(b) Mzlayzlam
(c) zyz
(d) zyzl

(xii) Find and display the position of the last space in a String s.
(a) char d=s.lastIndexOf(“ “);
(b) int d=s.lastIndexOf(“ “);
(c) int d=s.lastIndexOf(‘ ‘);
(d) int d=indexOf(‘ ‘);

(xiii) Write the output:


What is the value of a after executing the following code?
int arr[ ]={1,2,3,4,5};
int a=arr[1]*arr[4]+arr[2]%arr[3];
(a) 6
(b) 5
(c) 11
(d) 13

(xiv) What is the output of the below code:


int a[ ] = new int[50];
for(int i=1; i<=3; i++)
{
a[i] = i;
}
System.out.print(a.length);

(a) 3
(b) 0
(c) 4
(d) 30

(xv) __________ is a program written in the java programming language


that can be included in an HTML page.
(a) Applet
(b) Package
(c) Application
(d) Servlet

(xvi) They represent nongraphic characters:


(a) Keywords
(b) Literals
(c) Escape sequences
(d) Identifiers

(xvii) What is the output of the following code?


char c=’F’;
int i=10;
System.out.println(c+i);
System.out.println((int)c+i);

(a) F10
80
(b) F10
112
(c) 80
80
(d) 112
112
(xviii) To break a string apart, a Scanner needs a _______.
(a) Delimiter
(b) Text separator
(c) Text divider
(d) None of the above

(xix) Which one is a valid declaration of a boolean data type?


(a) boolean b1= 1;
(b) boolean b1= true;
(c) boolean b1= ‘true’;
(d) boolean b1= “true”;

(xx) String s=new String( );


The above statement will create an object of String with
(a) no characters
(b) one character
(c) space character
(d) null character

QUESTION NO 2:-

(i) What will be the output of the following code?


[2]
String St= “incandescent”;
(a) System.out.println(Character.toUpperCase(St.charAt(7))
+St.substring(3,6));
(b) System.out.println(“APPLICATIONS”.lastIndexOf(‘I’));

(ii) (a) Calculate the memory space occupied by the following String:

String s= “Google Chrome”;


(b) Write a java statement to read a character using Scanner class
functions. [2]

(iii) (a) What is an Array? Give an example.


(b) Write any 2 examples of Primitive and composite datatype.
[2]
1 3
(iv) Write the java expression for + 2
√ a+b x
[2]

(v) Explain the difference between static and dynamic initialization


by giving a suitable example.
[2]

(vi) Write the difference between unary, binary and ternary


operators [2]

(vii) Write the difference between equals( ) and compareTo( )

functions. [2]

(viii) Write the difference between simple expression and complex


expression. [2]

(ix) Write the output: [2]


String A[ ]= {“Chandan”, “Madhu”, “Manjula”, “Raju”, “Pooja”,
“Ramya”};
System.out.println(A[2].length( ));
System.out.printn(A[3].compareTo(A[5]);

(x) Write a java statement to perform the following tasks on a


string:
(a) To extract 5th character of the string m
(b) To extract last 3 characters of the string str.
[2]

SECTION B (60 Marks)


Attempt any four questions from this Section.
Each question carries 15 marks.
The answers in this section should consist of the programs in either
BlueJ environment or any program environment with Java as the
base. Each program should be written using Variable
descriptions/Mnemonic codes so that the logic of the program is
clearly depicted.
QUESTION NO 3:- [15]

Define a class in java to perform binary search on the list of numbers


given below (that are arranged in ascending order). Search for an
element input by the user, if it is found display the element along
with its position, otherwise display the message “SEARCH ELEMENT
NOT FOUND”.

5, 7, 9, 11, 15, 20, 30, 45, 89, 97

QUESTION NO 4:- [15]

Define a class to declare a character array of size ten, accept the character
into the array and perform the following:

• Count the number of uppercase letters in the array and print.


• Count the number of vowels in the array and print.

QUESTION NO 5: - [15]

i) Write a class to assign a full path and file name as given below. Using
library functions, extract and output the file path, file name and file
extension separately as shown.
Sample Input: C:\users\admin\pictures\flower.jpg
Sample Output: Path: C:\users\admin\pictures\
File name: flower
Extension: jpg
ii) A message is to be converted by adding 10 to the ASCII code
of characters in the statement given below. Write a program
to print the statement into a coded message.
Sample Input: YOKO HAS SMILED

Sample Output: cYUY RKJ JWSVON

QUESTION NO 6:- [15]


i) Write a program to print the following pattern:
ABCDE
ABCD
ABC
AB
A

ii) Define a class to input a string and convert into uppercase and print
the pair of vowels and number of pair of vowels occurring in the
String t.

Sample Input: BEAUTIFUL BEAUTIES

Sample Output: Pair of vowels: EA, AU, EA, AU, IE


No. of pair of vowels: 5

QUESTION NO 7:- [15]

Define a class to declare an array to accept and store 10 words. Display only
those words which begin with the letter ‘A’ or ‘a’ and also end with the letter
‘A’ or ‘a’.

QUESTION NO 8:- [15]

Define a class to accept values into a double array of size 20 and arrange the
elements in ascending order using Bubble sort. Print original array and sorted
array.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy