Formatting page ...
Royal Academy Pre-Board Test Subject-Computer Application Class-X Session-2022-2023 F.M. Time 2 hrs. Section -A (Attempt all the Questions from this 100 section) Ix20-20] QuestionChoose the correct answer and write the correct option. In object oriented programming, the stress is given on: i) 1. 2.methods Procedure 4. .data 3.class Which of the following principle does not allow to access directly from outside the class ii) premises: . "One things in many different form" goes with the 0OPs concept iii) . 2.encapsulation 3.classification 4. Polymorphism Inheritance The process by which a class acquires the properties from another class is called: iv) . 4.all of the above 2.encapsulation 3.abstraction data hiding Polymorphism 3. Abstraction 2.inheritance 4.object In procedural programming, the stress is laid on: v 1. 2.function Class vi) A.. . Abstraction vii) 1. 4.object . . IS a set of objects that has common attributes and common behavior. 2.encapsulation 3. class4.function What is the value of a after executing the statement int a=50; at=a+ ++a; vii) I. 3. Data 150 2.151 3. 149 4.152 Conditional operator also called Unary Operator 2. Binary Operator CAMOCK TEST 3.Ternary Operator 4.Logical Operator of1 What will be the final value ofa ix) public class test public static void main() int a=5; for(;a-5 if(a=5) break; at-2; System.out.println(a); 1.1 2.2 3.3 Scanner Class is 1. 4.4 _type of class. Primitive xi) 2. Derived 3.Wrapper int a=10; int p=10; pt=-a t --a; the output will be xi) 1. 26 2.27 3. 28 4.29 double c; int x,y,z; x=5; y=10; z=11; c=x*y+z/2; the value store in c is: xii) If (a==b) 1. 55.0 2. 55.5 3. 55 4.Super 4.None Ca else c=b; Can be written as: 1. c-(b--a)?a:b; 2. c=(a=b)?a:b; xiv) 3. e=(a-b)?b:a; 4.both a &b what will be the output of the following statement, when executed? System.out.printin(*COMPUTER".charAt(4)); 1. M 2.U 3.1 4.None xv) "School".substring(2,5) will result2. ool. sch 1. hoo 4.schoo xvi) Which of the xvii) Thefollowing statement: int code[]={25,37,38,42); following is correct usage? 1. Int af-40 xvii) 2. Int al40 1. Assign 37 to code[1] 2.Assign 25 to code[1] 2. Assign 38 to code[3] 4. Compartments Multiple Function 2. Function overloading 3. Floating function 4.None The function which changes the state of an object is known as: 1. XX) 4. none A function with many definitions is called 1. xix) 3.loat a[0-401 Pure function 2.Impure function 3.Floating Function 4.Nested Function The maximum number of object of a class type can be created as: . 1 MICM MAMOCKTLOT 2.2 3.3 4.0n the user's choice 1 of1 2x10-201 Question2 What will be the output ofthe given program- i) a. val-200 System.out.println(val); b. val=1600 int val, sum, n=550; sum=(n+val)>1750?400:200; System.out.println(sum); What will be the final value of a, b and c after executing the following code int a=5, b=6, c=12; ct-a + at+/++b -c*a++%c++/--b; ii) Rewrite the following using if else int c=(a!=b)?5:7; iv) Rewrite the following while loop using for loop int a=5; while(a=100) a+=5 How many times v loop will executed? What is the output of the same? int counter=1; do countertt; System.out.println(counter); while(++counter<=10); vi) Give the output of the following code: StringA="26",B="100" String D=A+B+"200; int x=Integer.parselnt{A); int y=Integer.parselnt(B); int d=x+y; System.out.printin("Result1="+D); System.out.println("Result2="+d); vil) Display the output of the following program segments: public vold display(int a, int b) A/CMAAMOCK TEST 1 of1 a=atb-(b-a); System.out.printin(a); System.out.println(b); vii) Define Polymorphism. ix) Consider the following program answer the question bellow: class sample int a,b; sample(int x, int y) a=X; b=y; void calculate) int z Z=atb; System.out.println(z); a. Name the global variable b. x) What are the method Find the output from the variables? following array int all-{2,4,6,8,10}; a10-23; a131-a int c=a[01+a[1]; System.out.println("Sum="+ ); Section-B XCE AMOCK PRST 1 of1 (Answer any four questions from this section) [15] WQuestion3 Define the class with following specifications Electricityy Class Name: Member variables: Opr - Opening Reading Clr- Closing Reading MU- Metered unit Rate_unit Rate per unit fixed - Total_amt - as 5.80 total amount Rental Rental charge fixed as 110 Tax- Service tax Bill- Final Bill amount [Declare the variables using appropriate data types] Member Methodvoid input()- Accept the details from the user through scanner class void calculate()- - opening unit metered unit=closing unit #rate/unit total_amount =metered unit Bill Amount =Total_amount + rental_Charge + Tax void display0 Display all the information in tabular format. [7.5+7.5-15] Question4- Print the following pattern i) 2 MJEBAAMOCK_TEST 4 5 6 7 8 9 10 1 of1 ii) 3 3 9 1 Question 5- |15 Consider the following statement"we are in the class of JAVA with BlueJ" Write a program to change JAVA to C+, Blue) to TurboC++, nd print as "We are in the class of C++ with TurboC++" Question 6- 5+10-151 i) Write a program in Java to find the sum and average and maximum of the numbers of the given Single Dimensional Array. Int m[l={23,31,44,56,72,55}; 11) Write a program in JAVA to store 20 temperatures C in S.D.A and display al the temperature after converting them into F. Hints: C/5-(F-32)/9 15 Question 7- Enter 10 element into an array and sort them in ascending order using Bubble sort as well as find the element as per user choice by Binary. [15 wQuestion 8- Write a program to accept a binary number and display the result in its decimal equivalent. Sample Input - 1010 Output- 10 the xICMRAMOCK TIST 1 of1
|