Trending ▼   ResFinder  

ICSE Class X Prelims 2024 : Computer Applications (Hiranandani Foundation School (HFS), Thane)

5 pages, 36 questions, 4 questions with responses, 4 total responses,    2    0
Flower
  
+Fave Message
 Home > star752 >   F Also featured on: School Page icse

Instantly get Model Answers to questions on this ResPaper. Try now!
NEW ResPaper Exclusive!

Formatting page ...

HIRANANDANI FOUNDATION SCH00L, THANE Second Preliminary Assessment- January 2024 Subject: Computer Applications Marks: 100 Time: 2 Hrs. Std. X Date: 18/O1/2024 to this paper must be written on the paper provided separately. You will NOT be allowed Answer towrite during the first 10 minutes. This time is to be spent for reading the question paper. The time given at the head of the paper is the time allowed for writing the answers. This paper is divided in two sections, Attempt all questions from Section A and any fourquestions from Section B. The intended marks for questions or parts of questionsare given in brackets[) This paper consists of 5pages. SECTION-A (Attempt all questions from this Section.) [201 Question 1: Choose the correct answer and write the correct option. CLASS public instance Outside Code variables private instance variables public methods private methods i) Name the concept of object oriented programming depicted in the above picture. (c) polymorphism (a) data hiding (b) encapsulation (d) inheritance ) What is the output of the following code? String nl = "46", n2 ="64": int total =Integer.parselnt(nl) + Integer. parseInt(n2); System.out.printin(total); (a) 110.0 (b) 110 (c) Error (d) Out of memory ii) Amethod which does not modify the value of variables is termed as (c) primitive method (a) impure method (b) pure method (d) user defined method iv) How many times the following do-while loop will be executed? int a, i; i-0; a=1; do { it+; a +t; }while(a <=5); System.out.printin("i =" +i+"a=" +a); (a) 2 times (b) 6 times (c) 4 times (d) 5 times v) Assertion (A): Wrapper class is used to convert any primitive data type into object. Reason (R): To achieve call by reference, we use the wrapper class. (a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A) (b) Both Assertion (A) and Reason (R) are true and Reason (R) is nota correct explanation of Assertion(A) (c) Assertion (A) is true and Reason (R) is false (d) Assertion (A) is false and Reason (R) is true vi) Constructor overloading follows which principle of Object Oriented (a) Inheritance (c) Polymorphism (b) Abstraction (d) Encapsulation vii) Name the statement you will use to achieve the functionality given below. (a) return statement (b) break statement Programming? depicted in the picture (c) system.exit(0) (d) continue statement while(condition) statement 1; if(condition) statement 2; statement 3: viii) What will be the final value of x, if the initial value of x = 6? x+=xt+ *2+++x %2 *3+ 2% (a) 20 (b) 22 (c) 24 (d) 23 ix) Assertion (A): Linear search can be carried on unsorted aray. Reason (R): Linear search searches an element in a sequential manner. (a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A) (b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion(A) (c) Assertion (A) is true and Reason (R) is false (d) Assertion (A) is false and Reason (R) is true x) valueOf) function converts (a) primitive type to string (c) Both (a) and (b) (d) None of the above (b) string to primitive type xi) Which of these is an incorrect array declaration? (a) int arr[] new int [5] (c) int[ ] arr = new int [5] (d) int arr[ )- int (5] new (b) int [ Jarr = new int [S] xii) What willbe the final value stored in variable x? x= Math.ceil(2.6) + Math.floor(2.6) + Math.round(2.6); (c) 8.0 (a) 9.0 (b) 8 (d) 9 xiii) Assertion (A): Aclass is a primitive data type. Reason (R): Aclass is auser-defined data type, i.e. it is created by the user, (a) Both Assertion (A) and Reason (R) are true and Reason (R) is acorrect explanation of Assertion (A) (b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion(A) (c) Assertion (A) is true and Reason (R) is false (d) Assertion (A) is false and Reason (R) is true xiv) What will be the output of following code snippet, ifn =500? int n, a =500; if(a+n* 10 > 5000) System.out.printin("100"); else System.out.println("200"); (c) S00 (d) 200 xv) These are the integral part of any program for the purpose of documentation (a) 100 (b) Syntax error or explanation? (a) Statenments (b)comments xvi) A/An (a) datatype bos (c) Blocks (d) Variables can access all variables and methods of class. (c) fields (d) object (b) constructor xvii) If s "123", which of the following will convert it into integer? (c) int a =parselnt(s); (a) int a = integer(s); (d) int a = Integer.parselnt(a); (b) int a = int (s); xviii) Assertion (A): Array is a data type which can store multiple homogenous variables. Reason (R): Elements of array are stored in an indexed manner starting with index 0. (a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A) (b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion(A) (c) Assertion (A) is true and Reason (R) is false (d) Assertion (A) is false and Reason (R) is true xix) It is a non-static method which is defined in a class and only accessible through the object of the class. (c) pure mnethod (a) instance method (d) class method (b) impure method Xx) Return data type of replace(char, char) is (a) int (c) String (b) Boolean (d) char [201 Question 2: i) Write a Java expression for the following: r'-4y? xy l2 ii) Rewrite the following code using while loop. int a = 100; for (int b-2; b<=30; b=b+5) { System.out.println("n" +(bta); a= a-2; ii) Rewrite the following program segment using ternary operator instead of the if-else statements. if (x %2 ==0) System.out.print("EVEN"); else System.out,print("ODD"); iv) What will be the output of the following code? int n= 4279, d: while(p>0) d= n%10; System.out.print(d); n=n/100: v) Fill in the below blanks with appropriate Java Method named void norm(int n) calculates thestatements. norm of a given Norm of a number is square root of sum of squares of all digits present in thenumber. number. Example: Input number =68 Sum of squares of all digits present 6 + 8'=36 + 64 = 100. Square root of sum= V100 = 10, Hence norm of 68 is 10. void norm (int n) int d, s (a) while b) ) d=n% 10; s= (c); n=n/10; System.out.println("Norm of "+n+ "is" (d) ); vi) Give two points of difference between call by value and call by reference. vii) What is a default constructor? vii) Explain function/method overloading. ix) What is a logical error? x) Differentiate between a continue statement and a returm statement. SECTION B (Answer any four questions from this Section.) The answers in this section should consist of the programs in either BlueJ environment or any program environment with java as the base. Each program should be written using variable description / mnemonic codes so that the logic of the program is clearly depicted. Flowcharts and algorithms are not required. Question 3. Define a Java class named FruitJuice with the following Class: FruitJuice specifications: [15] Member variables: int product code -To store the code of the product. - To store the flavor of the juice. (e.g. orange, apple etc.) String pack type - To store the type of packaging. (e.g. tetra-pack, PET bottle etc.) int packsize -To store the size of the package. (e.g. 200 ml, 400 ml etc.) double product price - To store the price of the product. double discounted price - To store the discounted price of the product. String flavour Member methods: (i) FruitJuice() - Constructor to initialize data members. (ii) void input) -To input and store the product code, flavour, pack type, pack size and product price. (iii) void discount() -To reduce the product price by 10%. (iv) void display() - To display the product code, flavour, pack type, pack size and product price. Write the main method to create an object of the class and invoke the above member methods. 4 Question 4. [15] Write a program to input any string to calculate the total number of characters and consonants present in the string. Sample Input: Input String: Hello Sample Output: Total number of characters: 5 Total number of consonants: 3 Question 5. [15] Design aclass to overload a method Joystring) as follows: (4) voId Joystring (String s, char chl, char ch2) with one string argument and two character arguments that replaces the character argument chl with the character argument ch2 in the given string s and prints the new string. Example: Initial value of s = "TECHNALAGY" chl ='A' ch2 ="0 Output: "TECHNOLOGY" () void Joystring (String s) with one string argument that prits the position of the first space and the last space of the given String s. Example: Input value of ="Cloud computing means Internet based computing" Output: First Index: 5 Last Index: 36 (ii) void Joystring (String s1, String s2) with two string arguments that combine the two strings with aspace between them and prints the resultant string. Example: Input value of sl "COMMON WEALTH" Input value of s2 = "GAMES" . Output: COMMON WEALTH GAMES Question 6. Define a class to accept two strings of same length and form a new word in such a way that, the first character of the first word is followed by the first character of the second [15] word and so on. Sample Input: BALL, WORD Sample Output: BWAOLRLD Question 7. [15] Write a program to check whether the given number is an automorphic number or not. An automorphic number is the number which is contained in the last digit(s) of its square. Sample Input: 25 and square of a given number = 625 25 is present as last two digits in its square i.e. 625. Sample Output: 25 is an Automorphic number. Question 8. [15] Define a class to declare a character array of size ten, accept the characters into the array and display the characters with highest and lowest ASCII value among the ten characters. Sample Input: c (] ={R,'x, 'q, 'A!,N, P,'m', "U,'Q, F } Sample Output: Character with highest ASCIl value =x Character with lowest ASCII value =A

Formatting page ...

Top Contributors
to this ResPaper
(answers/comments)


Adriel Darren

(2)

Raj More

(1)

Soumil Kuckian

(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

 

star752 chat