0% found this document useful (0 votes)
87 views4 pages

Icse Sample Paper-5 For Computer Applications

THIS IS THE SAMPLE PAPER FOR THE ICSE GRADE 10 COMPUTER APPLICATIONS

Uploaded by

edwin albert
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)
87 views4 pages

Icse Sample Paper-5 For Computer Applications

THIS IS THE SAMPLE PAPER FOR THE ICSE GRADE 10 COMPUTER APPLICATIONS

Uploaded by

edwin albert
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/ 4

SNV INTERNATIONAL SCHOOL – BHUMEL

Std : X Evaluation 1 September 22 Date: 17/09/22


Sub : Computer Time:2hours Marks:100
SECTION A (40 Marks)
Select the correct option for each of the following questions.
Question 1 Give the output of the following [5 x 1 = 5]
(a) int a=1;
for( ;true; a++)
{
System.out.print(a+”, ”);
if(a>3)
break;
}
1. 1,2,3 2. 1,2,3,4 3. 1,2,3,4, 4. 1,2,3,
(b) void calc(int a)
{
int x=2;
a=++a / x + a++/++x;
System.out.println(a);
} if 5 is passed to the function
1. 4 2. 5 3. 6 4. 7
(c) void test(char c)
{
System.out.println((int)c);
} if 'A’ is passed to c
1. Z 2. 65 3. 90 4. 97
(d) int a=10;
a+ = a++ + ++a + a-- - --a;
System.out.println(a);
1. 33 2. 34 3. 35 4. 36
(e) int m=3,n=5,p=4;
if(m==n)&&(n!=p)
{
System.out.print (m*n);
System.out.print (n%p);
}
if((m!=n)||n==p))
{
System.out.print (m+n);
System.out.println(m-n);
}
1. 151 3. 82
2. 8-2 4. None of the above
Question 2 Choose the correct answer [5 x 1=5]
a) if(a>b) c=a; else c=b; It can be written as :
1. c=(b>a)?a:b; 2. c=(a!=b)?a:b;

Page 1 of 4
3. c=(a>b)?b:a; 4. None of the above
(a) State the value of y after the following is executed:
char x='#';
y= Character.isLetter(x);
1. true 2. # 3. True 4. false
(b) Give the output of the following string methods:
"APPREHENSIVENESS".compareTo ("APPREHENSIVE");
1. 4 2. 32 3. -4 4. 46
(c) if(a<10)
st=“single digit”;
else if(a<100)
st=“double digit”;
else
st=“multiple digit”;
It can be written as:
1. st=(a<100)?(a<10)?”single digit”: “double digit” : “multiple digit”;
2. st= (a<100) :( a<10):”single digit”? “double digit” ? “multiple digit”;
3. st=(a<100)?(a<10): ”single digit”? “double digit” : “multiple digit”;
4. None of the above.
(e). Function overloading does not depend on
1. return type 3. number of parameters
2. type of parameters 4. all of the above
Question 3
Choose the correct option [5 x 1=5]
(a) _________ can be used in between the characters to separate the words of a variable name
1. space 3. underscore
2. comma 4. dollar
(b) The ________sign denotes that all the classes of the concerning package will be made
available for use in your program.
1. + 2. * 3. ^ 4. ~
(c) An if or else if statement accepts ______ as input before branching.
1. int 2. char 3. float 4. boolean

(d) An if-else construct accomplishes ‘fall through’.


1. True 2. False
(e) Math.ceil(-10.01) = ?
1. -11.0 3. -10.1
2. -11 4. -10.0
Question 4 Name the following [5 x 1=5]
(a) Which of the following packages is needed to find the square root of a number?
1. java.text 3. java.lang
2. java.math 4. None
(b) Which of the following is valid?
1. return (a); 3. both 1 and 2
2. return a; 4. None of the above
(c) What will be the return value of the following function test?
int test()
{

Page 2 of 4
int a=6, b=7;
int sum=a+b; int pr=a*b;
return(sum);
return(pr);
}
1. 13 3. 13,42
2. 42 4. 42,13
(d) Calling a method is also termed as
1. parameter passing 3. method header
2. invoking a method 4. none of the above
(e) Impure method is also known as
1. caller method 3. Mutator
2. operational method 4. none of the above
Question 5 [10 x 2=20]
A. Assume that i=1, j=2, k=3 and m=2. What does each of the following statements print?
a. System.out.println(i+j >=k);
b. System.out.println(!(k>m));
B. What is an infinite loop? Write an infinite loop statement.
C. What are wrapper classes? Give the name of the function that converts a string into int.
D. Write the output for the following:
String s1 = ''phoenix''; String s2 =''island'' ;
a. System.out.println (s1.substring(0).concat (s2.substring(2) ) );
b. System.out.println(s2.toUpperCase());
E. Write an expression in Java for C=A 3+2/|B|
F. What is a constructor? When is it invoked?
G. Write the return data type of the following function.
a. endsWith() b. toLowerCase()
H. Give the output of the following program segment:
double x=6.2, y=4.7;
a. System.out.println(Math.min(Math.floor(x),y));
b. System.out.println(Math.max(Math.ceil(x),y));
I. Give the output of the following.
a. “RABBIT”.replace(“B”,”P”); b. “TEAR”.compareTo(“DEAR”);
J. What will be the output of the following code?
a. System.out.println("FRIDAY". substring (3));
b. System.out.println("WONDERFUL". substring (3,6));
SECTION B (60 Marks)
Attempt any four programs [4X15=60]
Question 6 [15]
Write a menu driven program to accept a number and check and display whether it is a prime
number or not OR an automorphic number or not. (Use switch- case statement)
(a) Prime number: a number is said to be a prime number if it is divisible only by 1 and itself
and not by any other number. Example : 3, 5, 7, 11, 13 etc.,
(b) Automorphic number: An automorphic number is the number which is contained in the last

Page 3 of 4
digit(s) of its square. Example 25 is an automorphic number as its square is 625 and 25 is
present as the last two digits.
Question 7 Write a menu driven program to print the following patterns.
1. A 2. J J J J
BC AAA
DEF VV
GHIJ A
For incorrect choice, an appropriate message should be displayed. [15]
Question 8 [15]
Design a class to overload a function check ( ) as follows :
(i) void check (String str, char ch) – to find and print the frequency of a character in a string.
Example : Input: str = “success” ch = ‘s’ .
Output: number of s present is = 3
(ii) void check(String si) – to display only vowels from string si, after converting it to lower
case.
Example: Input: s1 = “computer”
Output: o u e
Question 9 Write a program to accept email id from the user and display, username, domain
name and extension
Sample Input: [email protected]
Sample Output: Username: computer
Domain name: gmail
Extension: com
Question 10
Design a class name Purchase with the following description :
Instance variables/ Data members :
String name – To store the name of the customer
long mobno – To store the mobile number of the customer
double cost – To store the cost of the items purchased
double dis – To store the discount amount
double amount – To store the amount to be paid after discount
Member methods: –
Purchase () – default constructor to initialize data members
void input() – To input customer name, mobile number, cost
void calculate() – To calculate discount on the cost of purchased items, based on following criteria.
Cost Discount (in percentage)
Less than or equal to 10000 2%
More than 10000 and less than or equal to 20000 5%
More than 20000 and less than or equal to 35000 7%
More than 35000 10%
void display() – To display customer name, mobile number, amount to be paid after discount
Write a main method to create an object of the class and call the above member methods.

Question 11 Define a class to accept a word in Lowercase and display the new word after
removing all the repeated letters.
Sample Input: applications
Sample output: aplictons [15]
Page 4 of 4

You might also like