Formatting page ...
Smt. Rukmanrani Education Foundations WISDOM HIGH INTERNATIONAL SCHOOL & JR. COLLEGE NASHIK QUESTION PAPER Academic Year: 2023-24 DI No. EXM/DI/03 |Location: SMC/GOC Rev:02 | Date:17.07.2023 Section: ICSE Released date: 13/01/2024 SECOND PRELIMINARY EXAMINATION GRADE: - 10(1CSE) SUBJECT: -Computer Application TIME: -2 hrs. HOD Sign: DATE:-03/02/2024 MARKS:-80 Head Sign: General Instructions: > Answers to this Paper must be written on the poper provided separately. > You will not be allowed to write during the first 15 minutes. The time is to be spent in reading the question paper, The time given ot the head of this Paper is the time allowed for writing the answers. > Section Ais compulsory. Attempt any four questions from Section B. > The intended marks for questions or parts of questions are given in brackets [ ]. Section A(Attempt all questions) [10 Question 1: Choose the correct answers to the questions from the given options. (Do not copy the question, write the correct answers only) (0) ldentify one of the important objective of programming depicted in the following [1 image. a) b) c) d) Loops Functions Inheritance Data Hiding is (i ) A blueprint that represents characteristics and behavior of a group of entities called .... a) object b) abstraction c) class d) polymorphism Grade 10(ICSE) Second Prelim Paper (2023-2024) (Released date: 13/01/2024) Page 1 (i) In the statement t=t+(itx); which variable is the accumulator a) i b) x c) t d) None of these (iv) Which of the following operators can operate on a boolean variable? && [1 ii. iV. +=2 a) i&i b) c) i, & iv i& iv i, ii & ii (v) Following are the features of OOP Planguage i. Emphasis is on functions (logical steps) It makes the complete program simpler by dividing it into a number of objects [1] It uses top-down approach of The concept of data hiding the security in The object can be used as aenhances bridge to have data flowprograms. programming V from one function to another. a) i, ii, v b) ii, i, v c) i, iv, v d) i, iv, v (vi) A ..constructor takes multiple arguments a) Parameterized constructor (1] b) Copy constructor c) Non-Parameterized constructor d) All of the above (vi) Corresponding wrapper class of float data type is, a) FLOAT [1) Float c) float d) Floating (vi) Aclass inheriting features of another clasS and adding its unique a) Base class features to it is [1 b) Super class c) Sub class d) Low class (ix) Consider the code given below. CH is a type of Character CH =new Character('K); a) character [1) b) object C) class d) variable Grade 10(1CSE) Second Prelim Paper (2023-2024) (Released date: 13/01/2024) Page 2 (x) valueOf( ) function converts a) primitive type to String (1] b) String to primitive type c) Character to String d) None of these (1] (xi) Asingle dimensional array contains Nelements. What will be the first subscript? a) N-(N-1) b) N-N c) N- (N+1) d) (xii) None of these The keyword that causes the control to transfer back to the method call. a) return b) continue c) break d) System.exit(0); (xiii) of Method overloading is one of the ways by which you can see the implementation [1) a) Inheritance b) Data hiding c) Encapsulation d) None of these (xiv) public boolean add(int m, Int n) In this given function header boolean is a) access specifier b) return: ntype c) method name (xv) d) parameter list Assertion(A): A keyword in Java cannot be used as an identifier. Reason(R): Keywords are reserved words and is being given a particular [1] operation/tasks to perform by the complier. 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 (xvi) Assertion(A): Achar data type can storea single character or an integer value in Java. characters. Reason(R): In Java, a char is a 32-bit data type that represents Unicode a a) Both Assertion (A) and Reason (R) are true and Reason (R) is (1] 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 (xvi) Which of these selection statements test only for equality? [1) a) if b) switch c) if &switch d) for Grade 10(ICSE) Second Prelim Paper (2023-2024) (Released date: 13/01/2024) Page 3 (xvii) How many times the loop, for (int i=1; ;i++), will execute, if there is no statement to terminate the loop? a) 1 b) 0 c) infinite d) none (xix) Find the ODD ONE OUT [1) a) Character.isUpperCase() b) Character. isWhiteSpace() c) Character.tolowerCase() d) Character.isDigit() (xx) Write the name of a statement that is used to skip a section of code in a loop. a) loop b) [1 continue c) break d) return Question 2: Answer the following () Write the (10] following in the shorthand form? A=A/15; [2 Write the output of the given System.out.printin("5.0statement, == 5L?"+(5.0 z=5L); (ii) Mention syntax if there is, else write the output of boolean b=false; the following code. if(b=true) [2 System.out.printin("b is true"); else System.out.printin("'b is false"); (i) Write the out put of the following code. String animal="unknown"; (2 int weight=700; char sex='m'; double colorWaveLength=1.630; if(weight>=s00) animal="elephant"; if(colanimal="gray orWaveLengt"+animal; h>1.621) if(sex>=f) animal="female "+animal; System.out.printin("The animal is a"+animal); (iv) Write the output of the given String na="Loop Structure"; statements, SysSystteem.m.ooutut.p.pririnntitnin((na.na.lareplstinadexOf A t ( 8 ) ce(na.s(nubsta.charring(4), "i:ng")): following (V) Debug the error and rewrite the int sum(x,v); i) function prototype, (2] float operate(int x, float=3.5f) Grade 10(CSE) Second Prelim Paper (2023-2024) (Released date: 13/01/2024) Page 4 (vi) Predict the output [2 int a=5,b=8; at=a+++++a+{b++ + ++a) +a+b; System.out.print1n(a);: (vii) Rahul is trying to implement a program in Java that calculates the factorial of a given (2) number using a while loop. However, his code is not producing the expected output. ldentify the logical and syntax errors in his code and rewrite them to ensure the correct calculation of the factorial. public int factorial(int x) { long fact=0; for(int i=1;i<=x;i++) fact=fact*i; return(fact): ) (vii) Sumedh has designed to code to check if the number is a prime number of not. He [2 has written the following code but the code is giving wrong output. Rewrite the code for the correct output. boolean flag=false; for(int i=2;i<=num;i++) if(num9%i==0) flag=true; if(flag) System.out.printin("Prime Number"): else System.out.printin("Not APrime Number"): (ix) Write the output of the following codes [2 int num[][={(3,5),(2,7),{1,9}); System.out.printin(num[2][1]+num[1][1]+num[0][1); also write its (x) Analyze the code and determine how many time the loop will execute, [2] output. int k=1,i=2; while(++i<6) k*=i; System.out.printin(k) Grade 10(ICSE) Second Prelim Paper (2023-2024) (Released date: 13/01/2024) Page 5 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 class ElectricBill with the following specifications: [15] class : ElectricBill Instance variables/ data member: String n-to store the name of the customer int units-to store the number of units consumed double bill -to store the amount to be paid Member methods: void accept()-to accept the name of the customer and number of units void calculate( )-to Number of units calculate the bill as per the following tariff: Rate per unit First 100 units Rs.2.00 Rs.3.00 Next 200 units Above 300 units Asurcharge of 2.5% is consumed Rs.5.00 charged if the number void print ()-To print the details as follows: Name of of units consumed is above 300 units. the customer: Number of units consumed: Bill amount:. Write a main method to create an object of the class and call the above member methods. Question Design a class SORT to accept 10 number is a Single Question 5: ascending order using SELECTION Sort Technique. Dimensional Array num, sort it in Write a program in java to accept a string, convert it into a PIGLATIN format. Sample input :TROUBLE Sample output: OUBLETRAY Aword is converted into form by extracting the characters from the vowel of the word. In the Piglatin first above example '0' is Question the first vowel. So the word is into two parts 'OUBLE' and TR (The divided before vowel). Then this two word are added by adding 'AY' at the end ofcharacters it. Design a class to store integer numbers in a 4 x 4 sum of the numbers of each row and sum of the Double Dimensional Array. Find the numbers of each column of the matrix by using an input statement. Sample Input 12 21 13 14 24 41 51 33 61 11 30 29 59 82 76 Sample Output The sum of the elements of 1st row = 60 The sum of the elements of 2nd row = 149 The sum of the elements of 3rd rowW= 131 The sumn of the elements of 4th = rowW 258 Grade 10(CSE) Second Prelim Paper (2023-2024) (Released date: 13/01/2024) Page 6 (15) [15] [15] Page7 13/01/2024) (Released date: (2023-2024) ='computer to it case. lower converting after Paper Prelim Second 10(l1CSE) Grade Output:oue Input: s1 Example: from vowels slstring , check(String s1) =3 presentis onlydisplay to void (i ) number sof Output: =s ch "success" and = stInput: r Example: character ain frequency aof the print and find to ch) char str, (String check void (i) string. follows: 15] check( as) function overloada to class Desigan Question X 8is HCF output: Sample 40 and :24 input Sample its print and tind class,scanner 15) usingnumbers (HCF) FactorCommon Highest toJava programin QuestionK Wraite TWO enter 1selements t of =156 column 3rdelements of 2ndelements of =135column =155column elements 4th of =152 column of sum The ofsum ofsum The The of sum The
|