Trending ▼   ResFinder  

ICSE Class X Prelims 2021 : Computer Applications (GEMS Modern Academy, Dubai)

5 pages, 30 questions, 5 questions with responses, 5 total responses,    2    0
Nandhana
Chavara Public School, Pala
Class 11, 12 PCMB
+Fave Message
 Home > nandhana741 >   F Also featured on: School Page icse

Formatting page ...

PRELIMINARY EXAMINATION 2021 COMPUTER APPLICATION Grade: 10 Duration: 2 Hours Date: 04/02/2021 Max. Marks: 100 [The time stated above is the time allowed for writing the examination. In addition, the first 15 minutes will be the time given for reading the question paper.] All working, including rough work should be done on the same sheet as rest of the answer. The intended marks for questions or parts of questions are given in brackets. Section A Answer all questions Give examples and briefly indicate the working or reasoning. Question 1 a. What is the purpose of a Constructor in a class? State at least 2 of its characteristics. [2] b. Give the output. System.out.println(Math.abs(Math.max(-14,-26))); System.out.println(Math.pow(-3,3)); [2] c. State the number of bytes required for the following arrays. i. int a[]=new int[4] ii. char ch[]=new char[20]; [2] d. (i) Name the package that contains the String class. (ii) Name the keyword that is used for allocating memory. [2] e. Differentiate between the methods charAt() and indexOf(). Give example. [2] Question 2 a. Define Encapsulation. [2] b. What is the difference between a break statement and a continue statement when they occur in a loop? [2] c. What is a Package in Java? Name 2 built-in packages. Name the package that is imported in a Java program by default. [2] d. What is the difference between an object and a class? Write a Java statement to create an object Bk of class Book. [2] e. Predict the output class overload { public static void calc(int a, int b) { int x = a / b; System.out.print(x); } public static void calc(double c, double d) { double x = c % d; Page 1 of 5 [2] System.out.print(x); } public static void main() calc( 10, 4.0f) } { } Question 3 a. Give the output of the following code snippets. Show the dry run or working. (i) int N=23; int cnt1=0; for(int K=N;K!=0;K/=2) { if(K % 2==1) cnt1++; } System.out.println(cnt1%2==0? "Even": "Odd"); [4] (ii) int a[ ]={17,10,9,18,7}; a[4%2]=++a[3]; a[5%4]=a[1] - a[3]++; System.out.print(a[0]+" "+a[1]+" "+a[2]+" "+a[3]+" "+a[4]); b. What is an Empty loop? Give an example. [2] c. Write the following snippet using a switch construct. if(speed == 75) System.out.println( Exceeding speed limit ); else if(speed ==69 || speed ==70) System.out.println( Getting close ); else if(speed == 65) System.out.println( Cruising ); else System.out.println( OK ); [2] d. Answer the following. [2] i) Write a statement to store a string variable N (that contains numeric data) in a variable D that is of double data type. ii) Write an if statement to check if the second character in a String (str) is in uppercase. Question 4 a. State two differences between equals() and the compareTo () methods in the String class. [2] b. Explain Explicit conversion with an appropriate example. [2] Page 2 of 5 c. Give the output of the following code snippet (with complete working). int Z=2, Q=0; do { switch(Z) { case 1: Q++; case 2: Q++; case 3: Q++; case 4: Q++; default: Q++; } System.out.println(--Q); }while(++Z<4); d. Give the output. Show the dry run. class alpha { public static void main( ) { char x[ ]={'a','b','c'}; change(x); for(int i=0;i<x.length;i++) System.out.print(x[i]); } public static void change(char a[]) { for(int i=0;i<a.length;i++) a[i]=(char)(a[i]+2); } } [2] [2] e. Give the output. Show the dry run. int Y[]={1999,2000,1996,1947,2020,1920,1988}; for(int K=0;K<Y.length;K++) { if(K%4==0) System.out.println(Y[K]); } Page 3 of 5 [2] Section B (60 Marks) Answer any 4. Comment lines and variable description needs to written. Question 5 [15] (i) Write a program that generates the 4 digits Strontio number. Strontio numbers are those 4 digit numbers when multiplied by 2 give the same digit in the hundreds and tens place. Ex: 1386*2 = 2772 1386 is a Strontio number. 9830*2 = 19660 9830 is a Strontio number. 9242 * 2 = 18484 9242 is not a Strontio number (ii) Write a program to compute the sum of the following series and display the sum S=x/2 x2/4+x3/6-x4/8+ ..xn/2n. Question 6 [15] Write a program that accepts the names of 20 cricketers and their countries in two arrays. Then accept the name of a country and print the names of all cricketers who belong to that country. Question 7 [15] Write a program to accept a String S from the user, convert it to uppercase and store the characters in the even index position in another String, STR . Do not store that character in STR if it is a space or a vowel or a number. Display the String STR as shown below. Sample Input : DISARI PUBLIC SCHOOL HALDIA 22 Output DSRLCSHD D DS DSR DSRL DSRLC DSRLCS DSRLCSH DSRLCSHD Question 8 [15] Design a class Myfun to overload the method count () as follows: int count(String, char) Counts the number of times the given character occurs in the given String and returns the count. int count(int m, int d) Counts the number of times the digit d occurs in the integer m and returns the count. If m is a single digit number or d is more than 1 digit then return -1. Create a main function to invoke the methods. Page 4 of 5 Question 9 [15] Define a class named BookFair with the following description: Instance variables/Data members: String Bname stores the name of the book. double price stores the price of the book. Member Methods: (i) BookFair() (ii) void Input() (iii) void display() (iv) double calculate() Default constructor to initialize data members. To input and store the name and the price of the book. To display the name and the discounted price of the book. To calculate and return the discount based on the following criteria Price Discount Less than or equal to Rs.1000 2% of price More than Rs.1000 and less than or equal to Rs 3000 10% of price More than Rs 3000 15% of price Write a main method to create an object of the class and call the above member methods. Question 10 Declare and initialize an array N with the numbers shown below. 3, 5, 6, 7, 19, 50, 51, 77, 45, 56, 57, 58, 40, 30, 31, 33, 34, 37, 39, 20 Perform the following operations. (i) (ii) Sort the data in descending order. Display the pair of numbers that are consecutive. Sample output: (i) Consecutive numbers 5 and 6 6 and 7 50 and 51 56 and 57 57 and 58 30 and 31 33 and 34 Page 5 of 5 [15]

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


Webster Harsh

(2)

..

(2)

Sai Bhosale

(1)

ResPaper Admins

(1)

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2025 ResPaper. Terms of ServiceContact Us Advertise with us

 

nandhana741 chat