Formatting page ...
SHANTINIKETAN TRUST SCHOOL #70 BILEKAHALLI, BANGALORE-76 II PREPARATORY EXAMINATION 2014-2015 SUB : COMPUTER APPLICATIONS Std. X ICSE 100 Total Marks : Answer 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 given for writing the answers. _____________________________________________________________________ This paper is divided into two Sections. Attempt all questions from Section A and any four question from Section B. The intended marks for questions or parts of questions are given in brackets(). _____________________________________________________________________ Section A (This section consists of 40 marks. All the questions are compulsory.) Q1. A) Write the syntaxes of functions equals() and compareTo() and explain their difference. (3) B) What do you mean by dynamic initialization of variables? (2) C) What is Byte code? Q2. A) What do you mean by a method prototype? Give an example. (2) B) Difference between instance variable and class variable. (2) C) What is the use of the this keyword? (2) Q3.A)What is the use of the getter and the setter functions? (2) B) What is the result produced by 2-10*3+100/11? Write the steps. (2) C) What is function overloading? (2) Q4.A) Explain the difference between call by value and call by reference. (2) B) Write the statement to create an object k of the class A. (1) C) Explain the working of linear search and binary search. (3) Q5.A) Differentiate between the two types of constructors. (2) B) What are composite data types? Why are they also called userdefined data types?(2) C) What is the output of : int x = 2; x += ++x * x++ * x--; System.out.println(x); Q6. A) Which are the three IO streams used in java? (2) B) Which are the 2 blocks associated with the try{ } block? (2) C) What do you mean by out of bound subscripts in arrays? Give an example. (1) Q7. A)What will be the output of the following? (2) i)StringBuffer sb=new StringBuffer( Application ); System.out.println(sb.reverse()); ii)String s= Java ; System.out.println(s.trim()); B) In order to use dates and times you need to import the __________ package. (1) C) Write the ternary operator equivalent to the following : (1) int x=8, y=9,c; if(x>y) c=x; else c=y; Q8. A) What will be the output of: (2) int i=1; while(i++<=1) { i++; System.out.println(i+ ); } Sytem.out.println(i); B) What will be contents of the following array after the 2nd iteration of Bubble sort?(2) 12,6,2,40,21,18,29,1 Section B (This section consists of 60 marks. There are 6 questions. Each question carries 15 marks. Attempt any 4 questions from this section.) (Each program should be written using Variable descriptions/Mnemonic codes such that the logic of the program is clearly depicted. Flowcharts and Algorithms are not required.) Q9. Write a menu-driven program using switch-case to perform the following : If choice=1, accept a sentence and extract the characters from 3 to end. If choice=2, accept a string using Scanner class and count the number of words in it. Else display Wrong choice . (15) Q10. Write a menu-driven program to perform the following : If choice=1, accept values into an integer array of size 10, and find the sum of all the even numbers in it. If choice=2, accept 15 values into an integer array and find the sum of all the prime numbers in it. Else display Wrong choice . (15) Q11. Define a class Taximeter having the following description: Data members: String taxino, String name, float km (Stores taxi no, passenger name and number of km) Member functions : Taximeter() - Constructor to store taxino as , name as , and km as 0.0 Input() Accept and store the values of member variables from the user. calculate() - Calculate the bill according to the given conditions : Km travelled Rate/km <=1 Rs.25 1<km<=6 Rs.10 6<km<=12 Rs.15 12<km<=18 Rs.20 >18 Rs.25 (15) Q12. Write a menu-driven program to perform the following : Choice=1, Accept a number from the user and check whether it is a palindrome or not. (A number is a palindrome, if when you read it in reverse order it is the same as the right order. Ex.101, 2112 etc.) Choice=2, Accept a number from the user and check whether it is a perfect number or not. (A number is a perfect number, if the sum of it s factors, other than the number itself, is equal to the number. Ex. 6 is a perfect number, as 6=1+2+3). (15) Q13. Define a class Student with the following members : Member variables : int studentNum, String studentName, float subject1, float subject2, float subject3, float total, float percentage Member functions: A parameterized constructor, a non-parameterized constructor, calculate()calculates and updates the total and percentage, display()-displays all the values. (15) Q14. Write a program to accept values into two 2D arrays of size 4x4. Find the sum of the corresponding elements of the two arrays and store in a third array. Display the third array. (15) XXXXXXXXXXXXXXXXXXXXXXX
|