Trending ▼   ResFinder  

ICSE Class X Prelims 2023 : Computer Applications (Unison World School (UWS), Dehradun)

6 pages, 96 questions, 25 questions with responses, 25 total responses,    0    0
Amrita Pandey
Unison World School (UWS), Dehradun
+Fave Message
 Home > amritapandey1 >   F Also featured on: School Page

Formatting page ...

2nd Preboard Examination /X / 24th January, 2023/Tuesday/ Computer Applications /Morning ________________________________________________________________________________ Time Limit: 2 hours MM: 100 Amrita Pandey - 16 Instructions This paper is divided into two sections Attempt 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) Q.1 (i) Choose the correct answer and write. In object-oriented programming .is the concept that has the ability for a message or data to be processed in more than one form. (a) Encapsulation (b) Polymorphism (c) Inheritance (d) Abstraction (ii) Richa wants the members of her class Books to be accessible only to her class Books , what access specifier she should use for the members? (a) public (b) protected (c) private (d) None of the above (iii) What will be the value of y if the value of y=2 and a= -3? y += a++ * a-- + --a (a) -4 (b) 2 (c) 0 (d) 4 (iv) Name the search algorithm which compares the sought key value with the key value of the middle element of the array at each stage. (a) Binary search (b) Selection search (c) Linear search (d) None of the above This document consists of 6 printed pages [20] (v) Data type int is included in .wrapper class. (a) Integer (b) Double (c) Float (d) Byte (vi) State the return type of the function Character.isUpperCase(char) (a) string (b) boolean (c) char (d) int (vii) int simplify(int p, int q) { p=p+q; return p; } The statement to call the above function will be: (a) obj.simplify(34,8) (b) simplify(34,8) (c) obj.simplify(34) (d) int z = obj.simplify(34,8) (viii) Which of the following variable is invalid? (a) Age_Emp (b) Num1 (c) Weight student (d) INT (ix) Single-line comments can be added using . (a) // (b) /* .*/ (c) \\ (d) Both a and b (x) Which of the following is a primitive data type? (a) array (b) class (c) interface (d) boolean This document consists of 6 printed pages (xi) The statement i=i+1 is equivalent to (a) i++ (b) ++i (c) i+=1 (d) All of these (xii) What will be the output of System.out.println(1==1)? (a) true (b) false (c) 0 (d) Syntax Error (xiii) What is the output of the following code? char ch = y ; char ch1= Character.toUpperCase(ch); int p=(int) ch1; System.out.print(ch1+ \t + p); (a) y 121 (b) y 89 (c) Y 89 (d) y 120 (xiv) What will be the output of the following code: int i=2, a=0; while(i<=10) { a = i++ * ++i; } System.out.println(a); (a) 100 (b) 20 (c) 10 (d) 120 (xv) In inheritance, the parent class is also known as the (a) Base class (b) Sub class (c) Inherit class (d) None of these (xvi) The access modifier that gives the most accessibility is: (a) private (b) public (c) protected (d) package This document consists of 6 printed pages (xvii) Identify the correct array declaration statement: (a) int a[10] (b) int a[i]=10 (c) int a[10]= new int[] (d) int a[]= new int[10] (xviii) What will be the value of: int v = System.out.print( HELLO .compareTo( hello )) (a) 32 (b) 12 (c) -32 (d) 0 (xix) A group of classes in Java is called . (a) Literal (b) Package (c) Function (d) Keyword (xx) State the output of the given code: char letter[]={ c , m , e }; System.out.println(letter[0] + letter[2]); (a) 200 (b) c+e (c) ce (d) None of these Q.2 (i) Differentiate between class variable and instance variable. [2] (ii) Rewrite the following using switch-case: char x; int m=0; if(x== a ) m=m+1; If(x== b ) m=m+2; [2] (iii) State the output: String x[]= { Unison , World , School }; System.out.println(x[2].charAt(2)); System.out.println(x[0].substring(0,1) + x[1].substring(0,1) + x[2].substring(0,1)); [2] (iv) Write the Java expression for the following: 2ab(a-b(4ac)) [2] This document consists of 6 printed pages (v) State the output : int a=10, b=20; System.out.println( +a+b); System.out.println(a+b); [2] (vi) State the output: int y[]={2,4,5,8}; for(int i=0;i<y.length;i++) { int p= y[i] +y[3-i]; System.out.println(p); } [2] (vii) Differentiate between compareTo() and equals() methods. [2] (viii) What is the use of escape sequences \n and \t ? [2] (ix) Create a parameterized constructor for the following object creation statement: Calculator cal= new Calculator(25,12, + ); with instance variables int num1, int num2 and char ch. [2] (x) Give the prototype of a function check() which receives a character ch and an integer n and returns true or false. [2] Section - B (Attempt any four questions in this section) Q.3 Define a class with the following specifications: Class name : ElectricBoard Member variables: String st = stores the customer s name int units stores the number of units consumed. double bill stores the amount to be paid Member methods: void accept() accept the name of the customer and units consumed. void calculate() - to calculate the bill as per the following tariff: Number of units Rate per unit First 200 units Rs. 4 Next 200 units Rs. 5 Above 400 units Rs. 7 void print() to print the details: name of the customer, units consumed and bill to be paid. Write the main function to create an object of the class and call the above member methods. This document consists of 6 printed pages [15] Q.4 Write a program to accept a number and check whether it is a Digi number or not. A Digi number has an even number of digits. If the number is split into two equal halves, then the square of the sum of these halves is equal to the number itself. Example: Input 3025 The Square of the sum of the halves (30+25)2 = (55)2 = 3025 is a Digi number. [15] Q.5 Define a class to accept values into a double array of size 10 and print the range of the array, range is the difference between the largest and the smallest element of the array. [15] Q.6 Define a class to overload a method show() as follows: (i) int show(int n) - to display the sum of the following series: 1+3+5+ n (ii) double show(double x) to display the sum of the following series: x10 + x9 + x8 + 1 (iii) void show()- to print the given pattern: A AC ACE ACEG [15] Q.7 Write a program to accept a string and the character from the user and calculate the frequency of the inputted character in the string. Example: Input : String BEAUTIES , character E Output : Frequency of E - 2 [15] Q.8 Write a program in Java to accept the year of graduation from school as an integer value from the user. Search the year of graduation, using Binary Search technique on the sorted array of integers given (1978, 1981, 1985, 1986, 1993, 1997, 1999, 2008, 2010, 2014). Output the message Record Exists if the value input is in the array. If not, output the message, Record does not exist . [15] .. . All the Best This document consists of 6 printed pages

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


S N

(25)

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

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

 

amritapandey1 chat