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

Cps+X-Computer+Applications-I-Prep

This document outlines the First Preparatory Examination for Computer Applications at Clarence Public School for Std X ICSE, scheduled for December 13, 2024. It includes instructions on answering the questions, the structure of the exam divided into two sections, and a variety of questions covering Java programming concepts. The document also specifies the maximum marks and time allowed for the examination.

Uploaded by

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

Cps+X-Computer+Applications-I-Prep

This document outlines the First Preparatory Examination for Computer Applications at Clarence Public School for Std X ICSE, scheduled for December 13, 2024. It includes instructions on answering the questions, the structure of the exam divided into two sections, and a variety of questions covering Java programming concepts. The document also specifies the maximum marks and time allowed for the examination.

Uploaded by

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

CLARENCE PUBLIC SCHOOL

J.P.Nagar, Bengaluru – 78
FIRST PREPARATORY EXAMINATION 2024 – 25
SUBJECT: COMPUTER APPLICATIONS MAXIMUM MARKS: 100
STD: X ICSE TIME: 2hrs
DATE: 13/12/2024
Total Number of Questions:8 Total Number of Pages: 8

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.
The time given at the head of this Paper is the time allowed for writing answers.
This Paper is divided into two Sections.
Attempt 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
(Attempt all questions from this Section)
Question 1 [20]
Choose the correct answers to the questions from the given options:
(Do not copy the question, write the correct answers only.)
(i)

What is the type of looping statement depicted in the above picture?


(a) Entry controlled loop (b) Exit controlled loop
(c) Multiple branching statement (d) All the above
(ii) _____________ is a composite datatype.
(a) int (b) user defined class (c) Arrays (d) both (b) and (c)

1
(iii) Method prototype for the method calculate which accepts two integer arguments and
returns a double value.
(a) public void calculate (int a, int b) (b) public double calculate (int a; int b)
(c) public double calculate (int a, int b) (d) public double calc (int a, int b)
(iv) Assertion (A): Members of a class can be accessed ONLY within the class.
Reason (R): It is a package level access.
(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
(v) Constructor returns _________ value(s).
(a) 0 (b) 1 (c) 2 (d) More than 2
(vi) What is the output produced by the following statement?
System.out.println (Math.round (Math.max (12.5, 13.4)));
(a) 14.0 (b) 14 (c) 13.0 (d) 13
(vii) The number of bytes occupied by a character array of size 40 is:
(a) 40 bytes (b) 80 bytes (c) 160 bytes (d) 20 bytes
(viii) Output of "CONFIDENT”. equals ("confident") is:
(a) false (b) 0 (c) true (d) 1
(ix) Name the type of error in the given code:
if (selling_price>cost_price)
System.out.println ("Loss");
else if (selling_price<cost_price)
System.out.println ("Profit");
else
System.out.println ("Neither profit nor loss");
(a) runtime (b) syntax (c) logical (d) no error
(x) Operator used to access the members of a class:
(a) new (b) ?: (c) + (d) . (dot)
(xi) Variable which maintains independent copy in every object is:
(a) instance (b) class (c) local (d) argument
2
(xii) Java statement to create an object chair of class furniture is:
(a) chair furniture = new chair(); (b) furniture chair = new furniture();
(c) furniture chair = new chair (); (d) new chair = furniture ();
(xiii) Predict the output:
int x=15; double y=14.5;
System.out.println (Integer.toString (x) + String.valueOf(y));
(a) 1514 (b) 14.515 (c) 1514.5 (d) 29.5
(xiv) Variable that is declared in the method block is:
(a) local (b) instance (c) static (d) argument
(xv) Identify the length (size) of an array given below:
int a[][] ={{4,2,1},{5,2},{1}};
(a) 6 (b) 3 (c) 12 (d) 24
(xvi) Method that returns part of a string is:
(a) charAt(int) (b) replace (char, char) (c) trim () (d) substring (int)
(xvii) "Actions speak louder than words"

true

14.78
Name the tokens in order from top, given in the above picture
(a) double, boolean, String (b) double, String, boolean
(c) String, boolean, double (d) String, String, double
(xviii) Assertion (A): an array is used to group different types of values.
Reason (R): it is a primitive data type.
(a) Both Assertion (A) and Reason (R) are true

(b) Assertion (A) is true and Reason (R) is false

(c) Assertion (A) is false and Reason (R) is true

(d) Both Assertion (A) and Reason (R) are false

(xix) return type of Character.toUpperCase (char) is:

(a) boolean (b) char (c) NILL (d) String


3
(xx) appropriate java statement to find the cube root of a number x is:
(a) Math.cbrt (x) (b) Math.pow (x,3) (c) Math.pow (x,1.0/3) (d) Both (a) and (c)
Question 2
(i) Consider the following program segment and answer the questions given below: [2]
int a[][]={{1,3,7,8}, {2,0,5,3},{8,9,4,5},{1,1,2,2}};
(a) System.out.println (a[0][2] + a[2][2] * a[3][1]);
(b) What is the memory capacity of a[][] in bits?
(ii) The following code prints only uppercase alphabets from the String s. Complete the
given code with appropriate statements:- [2]
public void display (String s)
{
for (int i=0; i<s.length () ;i++)
{
char c = ____(a)_____;
if (_________(b)________)
System.out.println (c);
}
}
𝐱 𝟐 +√𝐱+𝐲
(iii) Write Java expression for [2]
𝐲

(iv) Rewrite the following code using while loop: [2]


int x, y;
for (x=2, y=1; x<=15; x+=2, y+=2)
System.out.println (x*y);
(v) Evaluate the given expression when the value of m=6 and n=3 [2]
n+=++m + --n *m--;
System.out.println ("m="+m);
System.out.println ("n="+n);
(vi) What is the output of the following string methods? [2]
String a="Website", b="Webpage";
(a) System.out.println (a.compareTo (b));
(b) System.out.println (a.substring (0, 3).equals (b.substring (0, 2)));

4
(vii) Name the following:- [2]
(a) The search key element is compared with every element of an array from 0th index
position.
(b) Method that stops the execution of a java program at any stage.
(viii) How many times the following loop execute? Write the output of the code: [2]
int a=10;
while (true)
{
System.out.println (a);
if (a==1000)
break;
a=a*10;
}
(ix) Predict the output of the following code snippet: [2]
double x=1.234; String y="11";
System.out.println (String.valueOf (x).length ());
System.out.println (y.charAt (0) + 5);
(x) A student is trying to execute the following code to print double digit integers from an
array x[]. However he is getting an error. Identify whether it is a syntax/logical/runtime error
and also correct the code to get the desired output. [2]
public void doubleDigits (int x[])
{
for (int i=0;i<=x.length;i++)
{
if(x[i]>=10 && x[i]<=99)
System.out.println (x[i]);
}
}
SECTION B
(Answer any four questions from this Section)
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 description/mnemonic codes so that the logic
of the program is clearly depicted.
Flowcharts and algorithms are not required.

5
Question 3 [15]
Define a class with the following specifications:-
Class Name:- Sales
Instance variables:-
String n – customer’s name
int qty – number of computers purchased
int years – number of years with the dealer
double bill – amount to be paid
Member methods:-
void input () – accept details for n, qty and years
void calculate () – find the bill amount based on the following criteria:
Number of computers purchased Price per computer
Less than 20 `35,000/-
20 to 39 `31,000/-
40 or more `29,000/-
A customer gets a further 10% discount on the bill, if he deals with the dealer for more than 5
years.
void display () – print the customer’s name, qty, years and bill.
Write a main() method to create an object and call the above member methods.
Question 4 [15]
Define a class to accept n number of words in a single dimensional array. Arrange the words
in reverse alphabetical order using bubble sort technique. Display the sorted array.

Question 5 [15]
Define a class to accept a number and check whether it is a super number or not. A number is
called super when the sum of its digit raised to the power of their respective positions is
equal to the number itself.

Example:

Input Number: 175

Output: Super Number

[11 + 72 + 53 = 1 + 49 + 125 = 175]


6
Question 6 [15]
Define a class to overload the method display () as follows:
double display (int a, int b, int c) – calculate and return the area of the scalene triangle

𝐴𝑟𝑒𝑎 = √𝑠(𝑠 − 𝑎)(𝑠 − 𝑏)(𝑠 − 𝑐)


(𝑎+𝑏+𝑐)
Where 𝑠 =
2
void display (int n) – to display the following pattern for n rows using nested for loop.
For example if n is 3
A$A$
A$A$
A$A$
void display (String a, String b) – to display the first character of string a and the last
character of string b.

For example: a= "Graphics " and b= "Animation "


Output: First character of Graphics is G
Las character of Animation is n
Question 7 [15]
Define a class to accept a mobile number as string and check whether it is a valid mobile
number or not. Mobile number validation criteria are as follows:
The first digit should contain numbers between 7 and 9.
The rest 9 digits can contain any number between 0 and 9.
The mobile number can have 11 digits also including 0 at the starting.
The mobile number can be of 12 digits also by including 91 at the starting.
Example1:
Input String: 7873923408
Output: Valid Mobile Number
Example 2:
Input String: 5678729234
Output: Invalid Mobile Number
Input String: 07873923408
Output: Valid Mobile Number
7
Question 8 [15]
Define a class to accept values in 4x4 array and perform the following tasks:-
(1) Print the square of each element
(2) Find the sum of numbers that are divisible by 3
Example:
A[][]={{1,2,3,4},{5,6,7,8},{1,2,5,3},{8,2,4,6}};
Output:
Squares of each element:
1 4 9 16
25 36 49 64
1 4 25 9
64 4 16 36
Sum of numbers divisible by 3 = 18 (3+6+3+6) [from input array]
_______________

You might also like