0% found this document useful (0 votes)
5 views9 pages

ComputerApp MUSTKNOW X

The document outlines an academic syllabus for Computer Applications for Std. X at Shri Vile Parle Kelavani Mandal’s C.N.M. School for the academic year 2024-25. It includes a series of multiple-choice questions covering Java programming concepts, data types, operators, and class structures. Additionally, it provides programming exercises and class definitions for students to implement various functionalities in Java.

Uploaded by

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

ComputerApp MUSTKNOW X

The document outlines an academic syllabus for Computer Applications for Std. X at Shri Vile Parle Kelavani Mandal’s C.N.M. School for the academic year 2024-25. It includes a series of multiple-choice questions covering Java programming concepts, data types, operators, and class structures. Additionally, it provides programming exercises and class definitions for students to implement various functionalities in Java.

Uploaded by

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

Shri Vile Parle KelavaniMandal’s

C.N.M.School & N.D.ParekhPre-PrimarySchool


Std. X Academic Year 2024 – 25
Subject : Computer Applications (Group III)
Section - A
Q1. Choose the correct option for the following:
i. Name the feature of Java depicted in the following picture.
(a) Encapsulation (b) Data Abstraction (c) Polymorphism (d)
Inheritance
ii. Assertion(A): Logical NOT operator is a unary operator.
Reason(R): Logical NOT operator works only on one
operand.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of
Assertion (A).
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation
of Assertion(A).
(c) Assertion (A) is true and Reason (R) is false.
(d) Assertion (A) is false and Reason (R) is true.
iii. Predict the output:
System.out.println("MONARCH".substring(4).charAt(0));
(a) A (b) R (c) C (d) M
iv. Which of the following is not a token?
(a) Keyword (b) Identifier (c) Procedure (d) Operator
v. Which of the following statement is not valid for object-oriented programming language?
(i) Data values are secured.
(ii) No reusability concepts
(iii) Error detection and correction become easier
(iv) Easier in coding complex programs
vi. What will be the result produced by the following statement?
Math.ceil(-8.4) + Math.pow(2,-2);
(a) -8.0 (b) -9.45 (c) -7.75 (d) -8.25
vii. In this type of conversion, the data type of the result gets converted into a specific type as per user’s
choice.
(i) Implicit type conversion (ii) Explicit type conversion
(iii) both (i) and (ii) (iv) None of these
viii. The number of bytes occupied by an array of int type with 7 elements is:
(a) 56 (b) 7 (c) 14 (d) 28
ix. A function is invoked through an:
(i) parameters (ii) class (iii) object (iv) return
x. Assertion(A): A loop inside another loop is called a nested loop.
Reason(R): The break statement is used for exiting the loop.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of
Assertion (A).
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation
of Assertion(A).
(c) Assertion (A) is true and Reason (R) is false.
(d) Assertion (A) is false and Reason (R) is true.
xi. Which of the following is used to terminate the program?
(i) break (ii) return (iii) continue (iv) System.exit(0)
xii. __ is the technique of binding both data and methods together to keep them safe from
unauthorised access and misuse.
(i) Abstraction (ii) Inheritance (iii) Encapsulation (iv) Polymorphism
xiii. An IF or ELSE IF statement accepts as input before branching.
(i) boolean (ii) int (iii) float (iv) char
xiv. A code to read a double data type data from the keyboard using scanner class.
Scanner sc = new Scanner(System.in);
double d = ;
(i) sc.nextdouble() (ii) nextdouble() (iii) nextDouble() (iv) sc.nextDouble()
xv. What is the output of the following code?
public class Test {
public static void main(String[] args)
{ int[][] matrix ={{1, 2, 3, 4},{4, 5, 6, 7},{8, 9, 10, 11},{12, 13, 14, 15}};
for (int i = 0; i < 4; i++)
System.out.print(matrix[1][i] + " ");} }
a) 1 2 3 4
b) 4 5 6 7
c) 1 3 8 12
d) 2 5 9 13
xvi. The access specifier that gives the least accessibility is
(i) Public (ii) Private (iii) Protected (iv) both (ii) and (iii)
xvii. The parameters which are declared in function definition are called
(i) Actual parameters (ii) Formal parameters (iii) Original parameters
(iv) Duplicate parameters
xviii. Assertion (A) The return statement causes program control to transfer back to the caller of the method.
Reason (R) The return statement immediately terminates the method in which it is executed.
a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct
explanation of Assertion (A).
b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a
correct explanation of Assertion (A).
c) Assertion (A) is true and Reason (R) is false.
d) Assertion (A) is false and Reason (R) is true
xix. The prototype of a function test which receives two string arguments and returns a character.
a) char test(Str s1 ,Str s2) b) int test(String s1 ,String s2)
c) double test(String s1 ,String s2) d) char test(String s1 ,String s2)
xx. It is an intermediate code created after compilation of Java source code.
(i) class code (ii) byte code (iii) machine code (iv) JVM code
xxi. It does not return any value.
(i) break (ii) continue (iii) void (iv) return
xxii. The keyword used to access members of another package.
(i) import (ii) static (iii) class (iv) switch
xxiii. The keyword that distinguishes between instance variable and class variable.
(i) this (ii) void (iii) public (iv) static
xxiv. It is used when number of iterations are known.
(i) while() (ii) for() (iii) both (i) and (ii) (iv) None of these
xxv. double x=2.4,y=2.5;
System.out.println(Math.min(Math.ceil(x),y; (i) 2.0 (ii) 2.4
(iii) 3.0 (iv) 2.5
xxvi.If x = 9, find the value of x* = (--x/x++) + ++x – (x--%x); (i) 18 (ii)
108 (iii) 90 (iv) 20
xxvii. Method that accepts a string without any space is _______
(i) next() (ii) nextLine() (iii) nextInt() (iv) None of the above
xxviii. int i, n=1;
for(i =1; i>=5; i++)
n=n*i;
System.out.println(i+ “,” + n);
(i) 6, 120 (ii) 1, 1 (iii) infinite loop (iv) compiler error

Q2. Write the output of the following :


i) What will be the output of following segments:-
a) String s="Examination";
int n=s.length();
System.out.println(s.startsWith(s.substring(5,n)));
System.out.println(s.charAt(2)==s.charAt(6));
b) "MISSISSIPPI".indexOf('S')+ "MISSISSIPPI".lastIndexOf('I')
c) char x='7'; y= Character.isLetter(x);
d) String x = (a >= 90) ? "excellent" : "best"; when a = 90
e) String str = new String("ICSE Examination 2017");
System.out.println(Integer.valueOf(str.substring(str.length()-3))+ str.length());
System.out.println(str.substring(0,4)+str.lastIndexOf("a"));
f) String str="cnms school";
char c1=Character.toUpperCase(str.charAt(0));
char c2=Character.toUpperCase(str.charAt(str.lastIndexOf(" ")+1));
System.out.println(c1 +" . "+ c2);
g) char ch=’b’;
int m=ch;
m=m+5;
System.out.println(m+ “ ”+ch);
h) double x= 2.9 , y=2.5;
System.out.println(Math.min(Math.floor(x),y));
System.out.println(Math.max(Math.ceil(x),y));
i) int a=63, b=36;
boolean x = (a>b) ? true : false ;
int y=(a<b) ? a : b;
j) double p=Math.pow(4,2)+Math.cbrt(27);
System.out.print(p);
k) System.out.println("Incredible"+"\n"+"world");

ii) Rewrite the following using ternary operators:


if(n1<n2)
x= ‘b’;
else
x=‘B’;
iii) Evaluate the expression:
X+=++A + --B + A++ + B--;
where A=5, B=10, C=10
iv) Write an expression in Java for :

v) Convert following do-while loop into for loop.


int i=1; int d=5;
do{
d=d*2;
System.out.println(d);
i++;
}while(i<=5);
vi) How many time the loop is executed and what is the output?
n=1000;
while (n>10)
{
n=n/10;
}
System.out.println(n);
vii) Consider the following program and answer the questions given below:
class sample
{
int a,b;
static int c;
sample(int a1, int b1)
{
a=a1;
b=b1;
}
void compute()
{
int result;
result=a+b;
System.out.println(result);
}
publis static void main()
{
sample ob=new sample(5,8);
ob.compute();
}
}
(a) Name the instance variables and its value.
(b) Name the class variable.
(c) Name the argument/method variable.
(d) Name the local variable.

Section – B
1. Define a class Employee having the following description:
Data members:
String name : to store the name
double income : to store the annual taxable income double
tax : to store the tax
Member functions :
input() : to enter the pan number, name and taxable
income calc() : calculate tax of an employee
display() : output details of an employee
Write a program to compute the tax payable based on the following conditions :-
Annual income Annual tax deduction %
<= Rs. 300000 0%
Rs.300001 to Rs.500000 10% of income exceeding 300000
> Rs. 500000 20% of income exceeding 300000
Write a main method to create an object and call the methods.
2. The following program is based on the specification given below. Fill in the blanks with appropriate java
statements.

Class name: Library

Instance variables/Data members:


String name – to store name of the book
int days – to store number of days book return late. double
fine – to store fine charged
Member methods:
Library() – Constructor to initialize data members.
void input() – to input name of the book and number of days return late. void
calculate() – calculate the fine charged as follows:
First five days 40 paise per day
Next five days 60 paise per day
Above ten days 80 paise per day
void printing() – Display the fine charged.
Write a main method to create an object of a class and call the above member methods.

3. Write a program to accept a number and check whether it is a devil number of not. (15)
A number is devil if it has even number if 1’s present in it. E.gs. 7121, 115, 7122111 etc.
4. Design a class to overload a function volume() as follows:
(i) double volume(double r) – with radius ‘r’ as an argument, returns the volume of sphere using the
formula:
v = 4 / 3 × 22 / 7 × r3
(ii)double volume(double h, double r) – with height ‘h’ and radius ‘r’ as the arguments, returns the
volume of a cylinder using the formula:
v = 22 / 7 × r2 × h
(iii) double volume(double l, double b, double h) – with length ‘l’, breadth ‘b’ and height ‘h’ as the
arguments, returns the volume of a cuboid using the formula:
v=l×b×h
5. Write a program to accept a number and calculates the norm of a number, norm of a number is square root
of sum of squares of all digits of the number. Example: The norm of 68 is 10 6×6 + 8×8 = 36+64 = 100
square root of 100 is 10.
6. Write a program to accept two numbers and check for Amicable number (Note: Amicable number are pair
of numbers such that one is the sum of proper factors of the other. For example : 220 and 284 , since
sum of factors of 220 = 1+2+4+5+10+11+20+22+44+55+110=284
sum of factors of 284=1+2+7+71+142=220)
7. 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.
8. Define a class to declare an array of size 20 of double datatype, accept the elements into the array and
perform the following:
• Calculate and print the sum of all the elements.
• Calculate and print the highest value of the array.
9. Write a program to accept a word in upper case and display the character with the highest ASCII value as
well as the character with the lowest ASCII value contained in it. [15]
Input: AUTOMATA
Output: Character with highest ASCII value is U and lowest ASCII value is A
10. Define a class to accept two strings, convert them into uppercase, check and display whether two strings
are equal or not, if the two strings are not equal, print the string with the highest length or print the message
both the strings are of equal length
11. Define a class to accept and store 10 strings into the array and print the strings with even number of
characters.
12. 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”. {1982, 1987,
1993, 1996, 1999, 2003, 2006, 2007, 2009, 2010}
13. Write a java program to accept 10 players name with score. Find and print the highest scorer and lowest
scorer with score.
14. Write a program to accept 10 students name and arrange alphabetically using bubble sort technique.
15. Define a class to accept a word in upper case and replace each vowel found in the word by its immediate
succeeding letter and form a new string. Display the resultant string with a proper message.
16. Design a class to overload a function Joystring() as follows :
(i) void Joystring(String s, char ch1, char ch2) with one string and two character arguments that replaces the
character argument ch1 with the character argument ch2 in the given string s and points the new string
g.
Example : Input value of s =TECHNALAGY"
ch1 = 'A' , ch2 = 'O' Output : "TECHNOLOGY"
(i) void Joystring(String s) with one string argument that prints the position of the first space and the last
space of the given String s.
Example: First Index : 5 Last Index : 36
(ii) void Joystring(String s1, String s2) with two string arguments that combines the two strings with a space
between them and prints the resultant string
Example : Input value of s1 = "COMMON WEALTH"
s2 = "GAMES"
Output : "COMMON WEALTH GAMES"
17. Write a program to accept 20 integer to store in an array and arrange in descending order using selection
sort technique.
18. Write a program to accept the names of 10 countries in a single dimension string array and their famous
place in another single dimension array. Search for a name of a country input by the user in the list. If
found, display “Search Successful” and print the name of the country along with famous place, or else
display the message” Search Unsuccessful, no such country in the list”.
19. Write a program to input and store integer elements in a double dimensional array of size 4×4
and find the sum of all the elements.
7345
5461
6942
3275
Sum of all the elements: 73
20. Write a program to create 3 x 3 matrix and store first 9 natural numbers in it in the following
manner:
123
456
789
Calculate the sum of right diagonal and sum of even elements using loop.
21. Design a class to accept some integers in a matrix (double dimensional array) of size 3x3. Now,
compute and print the sum of the leading diagonal elements as well as the counter diagonal elements
separately.

Example:

If, A[ ][ ] =

254

038

457

Then, the sum of the leading diagonal elements = 2 + 3 + 7 = 12


And, the sum of the counter diagonal elements = 4 + 3 + 4 = 11

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

You might also like