0% found this document useful (0 votes)
9 views5 pages

Sample Paper

This document is a sample paper for a Computer Applications exam, consisting of two sections with a total of 100 marks and a time limit of two hours. Section A contains multiple-choice questions and fill-in-the-blank questions related to Java programming concepts, while Section B requires students to answer programming-related questions and write code for various tasks. The paper includes questions on topics such as class design, control structures, and data types in Java.

Uploaded by

chompchompy123
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)
9 views5 pages

Sample Paper

This document is a sample paper for a Computer Applications exam, consisting of two sections with a total of 100 marks and a time limit of two hours. Section A contains multiple-choice questions and fill-in-the-blank questions related to Java programming concepts, while Section B requires students to answer programming-related questions and write code for various tasks. The paper includes questions on topics such as class design, control structures, and data types in Java.

Uploaded by

chompchompy123
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

SAMPLE PAPER6(UNSOLVED)

COMPUTER APPLICATIONS

Maximum Marks: 100


Time allowed: Two hours
provided separately.
Answers to this Paper must
be written on the paper
during the first 15 minutes.
You will not be allowed to write
question paper
This time is to be spent in reading the for writing the answers.
time given at the head of this Paper is the time allowed
The
Sections.
This Paper is divided into two
section B.
andany four questions from
Attempt allquestions from section A
of questions are given in brackets LJ.
The intended marks for questions or parts

SECTION-A
(Attempt all questions from this Section.)
[20]
Question 1.
multiple purposes.
() Name the java concept that allows a function to be used for
(c) Polymorphism (d) Encapsulation
(a) Inheritance (b) Abstraction
(i) Which of the following is a character literal?
(c) "11" (d) false
(a) lo (b) 0
(i) State the type of error in the given java statement:
if a>b {[Link]("Greatest number" + a);}
(a) Syntax error (b) Logical error (c) Runtime error (d) No error
(iv) Which of the following is a relational operator in java?
(a) = (b) & (c) == (d) ^
(v) Which of the following is a syntax error?
(a) double a= log (0) +3 (b) double x = [Link](25);
(c) [Link]("Computers"); (d) return 125*25.5
(vi) Which of the following is not a package?
(a) [Link] (b) [Link] (c) [Link] (d) [Link]
(vii) Which of the following is not an advantage of java package?
(a) Provides access protection
(b) Rernoves naming collision
(c) To store primitive values in objects
(d) Categorises the classes and interfaces so that they can be easily maintained
(vii) Which of the following is a function signature?
(a) public

SAPM LERS
(b) static (c) void (d) main ()
(ix) State the error in the given statement
int a [] = {1,2,3},
(a) Logical error (b) Syntax error (c) Runtime error
(x) Which of the following java concept wraps data and functions into a (d) No Error
single unit?
(a) Polymorphism (b) Transient (c) Encapsulation
(xi) Which of the following is a Boolean literal? (d) Multi inheritance
(a) 0 (b) true (c)"0"
(d) False
452
SAMPLE PAPER 6 (UNSOLVED)453

(vii) Evaluate the value ofs in the following expression


String s "Computer".substring(0,7).compareTo("Compute") ==0?"Equal": "Not Equal":
(a) Invalid (b) "Equal" (c)" Not equal (d) Syntax error
(xi) What is the purpose of the 'continue' keyword?
(a) to exit the loop (b) to break the loop
(c) to skip the current iteration (d) no such keyword
(xiv) Which of the following is not a function in java?
(a) next () (b) nextline() (c) nextLong) (d) nextlnt()
(xv) Which of the following is not a type of comment in java?
(a) single line comment (b) multi line comment (c) double line comment (d) documentation
(xvi) Assertion (A): An argument is a value that is passed to a method when it is called.
Reason (R) : Variables which are declared in a method prototype to receive values are called actual pararneters.
(a) Both Assertion (A) and Reason (R)are true and Reason (R) is acorrect 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.
(xvii) Which is not a data type in java?
(a) double (b) int (c) Boolean (d) long
variables.
(xviii) The variables that the object contains are called
(a) Instance (b) abstract (c) static (d) none of these
(xix) If an instance goes away, so does the
(c) operands (d) none of these
(a) variable (b) operators
(xx) Assertion (A) : Integer class can be used in the program without calling a package.
Reason (R) : It belongs to the default package [Link].
explanation of Assertion (A).
(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
(c) Assertion (A) is true and Reason (R) is false.
(d) Assertion (A) is false and Reason (R) is true.
Question 2. [2]
(a) Fill in the blanks :
signature are called parameters.
() The parameters appearing in the function
function call by
(i) Injava, primitive types are passed in [2]
break statement in java.
(b) State the difference between a continue and [2]
statement:
(c) Rewrite the folowing code using the switch
if (ch=-M'||ch=='m')

[Link] ("Manager");

else if (ch=-C'|| ch=-c)

[Link]("Clerk");

[Link] ("Custormer");
}
else if (ch==P'||ch==p)
Class X
454 VATSAL ICSE COMPUTER APPLICATIONS HANDBOOK
[Link]("Parents");

}
else
{
[Link]("others");

(d) What is the minimum and maximum value displayed by this loop?
int x=10, İ=0;
while(i+H <X)
[Link](+i + "t");
[2]
(e) Name the keyword :
() that allows the execution of a method function without creating an object.
statement.
(i) that causes the control back to the method/function call
"Friday", "Saturday"}; [2]
(f) String xl]={"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
Give the output of the following statements :
(i) [Link](x[2]. length( )>x[6].length( );
(i) [Link](x[3].substring (0, x[3].length()3) + x[5].substring(3);
[2]
(g) Give the output of the following program:
public class icecream

private String flavour;


private double price;
public icecream( )

this(10.5);
[Link]("In default constructor");

public icecream(double a)

flavour-vanilla";
price=a;
[Link]( );

public void display( )

[Link]("Flavour-"+ flavour");

SPAMELRS [Link]("Price="+ price");


}
public static void main )

icecream ob=new icecream( ):


455
SAMPLE PAPER6 (UNSOLVED)
(h) Integer in=new Integer(50); [2]
Write a statement to unbox the above object.
() Write the output of the given code : [2]
int x=-5;
for (int f-10; f>-9; f-)

for (int g=1; g<f; g++)


[Link] (X++");
[Link]( );
(2]
(i) What is the difference between default and public access specifier in java?
SECTION-B
(Answer any four questions from this Section.)

programs in either Blue J environment or any


The answers in this section should consist of the
program environment with java as
the base.
description/mnemonic codes so that the logic of the
Each program should be written using variable
program is clearly depicted.
Flowcharts and algorithms are not required.
Buffered Reader / Data Input Stream should not
be used in the programs.
[15]
Question 3.
description :
Design a class Electricity with the following
Data members/Instance variables :
Cust name tostore the name of the customer
Custid
to store the id of the customer
to store the name of the month.
month consumed.
to store the total number of units
unit
tostore the total charges.
amount
Member functions/methods : members.
parameterized constructor to assign values to all the data
electricity) as per the given tariff.
void calculate( ) to calculate the total amount of bill
Charges
Units
71.75/unit
units<=100

units>100 and <=300 2.50/unit


units>300 and <=500
3.50/per unit
{4/unit

PSAMEPRLS
units>500
specified format.
display the details of the customer in the format :
to the phone billin the following
void display () methods to display
create an object and callthe above
Write the main method to Units Amount
Customer name
Customer ld XXXXXX
(15]
XXXX
XXXXXX
XXXX
patterns.
Question 4. a menudriven program to print the
following

case statement write


Using the switch
HANDBOOK Class X
VATSAL ICSE COMPUTER APPLICATIONS
|456|
(i)
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
3 2 1
3 2 1
2 1
1
(ii)
1
1 21
1 2 3 2 1
12 3 4 3 2 1
1 2 3 45 4 3 2 1 (15]
Question 5. descending order of their
(uppercase) words in an array. Sort
the words of the array in
Write a program to input n
strengths using bubble sort technique.
e.g., Leta word is LIGHT:
its strength = 12 + 9+7 + 8 + 20 = 56
encrypted value of each alphabet.
(Note : The strength of a word is found by adding the
1, B= 2, C=3, D = 4.... Z = 26.)
The encryption of alphabets are to be done as A =
(15]
Question 6.
and then output it in words :
Write a program to input a natural number less than. 10000
e.g., INPUT : 29
OUTPUT: TWENTY NINE
INPUT : 225
OUTPUT:TWO HUNDRED AND TWENTY FIVE

Question 7. [15]
Design a class to overloada function number( ) as follows :
) void number (int n)-with one integer argument and displays the prime factors of n.
() boolean number ( )-to input a number. Check whether the number is a special number or not and return true or
false accordingly.
(A number is said to be a special number if the sum of its digits multiplied by product of its digits is egual to the
original number. e.g., 144
144 = (1 + 4 + 4) + (1 + 4 4) =9 16 = 144
(i) void number (int n, char ch)-with one integer argument and one character argument. If ch='p' then calculate and
display the product of first and last digit of the number. If ch='s then calculate and display the sum of the digits
excluding the first and last digit of the number.
Question 8. (15]

Given two positive nunbers M and N, such that M is between 100 and 10000 and N is less than 100. Find the
smallest integer that is greater than M and whose digits add upto N.
e.g, if M - 100 and N - 11, then the snallest integer greater than I00whose igits add up to ll is 119.
Write a program to accept the numbers M and N trom the user and prnt the smallest required oumber whose sum
of all its digits is equal to N.

You might also like