Formatting page ...
AKASH INTERNATIONAL RESIDENTIAL public SCHOOL Prasannahalli road, Devanahalli, Bangalore - 562 110 Preboard Examination - January 2016 Class: X - ICSE SUBJECT: Computer Application Maximum Marks: 100 Duration: 2 hour 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 the answers. This paper is divided into two sections. You are to answer 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 ( 40 Marks ) Answer all the Questions Question 1 [10] a) Write java expression: ut + at2 [2] b) Give any four tokens. [2] c) What are library classes ? Give an example. [2] d) Give the output of the following java code: int i = 0; for (i = 10; i>1; i--) if (i%5 == 0) System.out.println( i + is divisible by 5 ); e) State two non-numeric primitive data type. Question 2 a) Give the value of x and y of the following: [2] [10] [2] String St1 = Good ; String St2 = World Matters ; String x = St2.substring (5).replace ( t , n ); String y = St1.concat (x); b) Rewrite the following code using ternary operator. [2] int m = 500; if (m<1000) n = 1000*0.05; else n = 1000*0.10 c) What is the difference between == and equalsIgnoreCase() [2] d) What is function prototype? Explain. [2] Question 3 [20] a) Give the output of the following: i) int N = 35 ; if(N>0 && N<20) N++; else N-- ; System.out.println(N); [2] ii) char op = c switch (op) { Case a : System.out.println( Welcome to Java ); break; Case b : System.out.println( Java is Object Oriented ); break; Case c : System.out.println( Java is Platform Independent ); break; Default: System.out.println( Invalid Input ); } [2] iii) int A [ ] = {2,4,6,8,10,12,14}; System.out.println(A.length); System.out.println(A[4]); [2] iv) k = 3 and j = 4 [2] 1. k += k++ ++j + k; System.out.println(k); 2. k *= ++k + --j; System.out.println(k); v) int a = 10, b = 4; 1. a = 10 * ++ a; System.out.println(a); 2. a = a % b ; System.out.prinln(b) [2] vi) void show() { int y [] = {5,7,8,6}; int q = y.length; int p = 0; for (int i = 0; i<q; i++) { p = y [i] + y [3-i]; System.out.println(p); } } [4] b) Read the following java program code and explain line 1, 2 & 3 class Java { static double n; public void IP (double m) { n = m; n = n+2; } public void OP() { System.out.println(n); } public static void main (String [] args) //line 1 { Java X = new Java (); //line 2 X.IP(20); X.OP(); //line 3 } } [6] SECTION B ( 60 Marks ) Answer any four questions [4 x15 = 60] Question 4: Write a java program to input value of x and n, display sum of the series: [15] sum Question 5: Input a sentence and print the same sentence after converting every alternate character to uppercase and immediate next character in lowercase. For example: Input: Akash International School Output: AkAsH iNtErNaTiOnAl sChOoL [15] Question 6: Define a class called Student to check the student is eligible for taking admission [15] in a special course with the following description: Instance variables : String name : to store name int Mathmar : to store maths marks int Scimar : to store science marks int CAmar : to store Computer Applications marks boolean eli : to store whether a student is eligible for a course Methods: Student() : parameterized constructor Check() : to check the condition for eligible for course Display() : to print whether eligible or not The eligibility conditions are: 1. Average of Computer and Science should be more than 95% 2. Average of Maths and Science should be more than 90% Question 7: Write a program to input 10 integer elements in an array and sort them in ascending order using bubble sort technique. [15] Question 8: Write a program to accept a string. Convert the string to uppercase. Count and output the number of double letter sequences that exist in the string. Sample Input: SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE Sample Output: 4 [15] Question 9: Using the switch statement, write a menu driven program: (i) To check and display whether a number input by the user is a composite number or not (A number is said to be a composite, if it has one or more then one factors excluding 1 and the number itself). (ii) To find the smallest digit of an integer that is input: Sample input: 9237 Sample output: Smallest digit is 2 For an incorrect choice, an appropriate error message should be displayed. *** [15]
|