Formatting page ...
___________________________________________________________________________ 2017-18-Prefinal___________ TAMRALIPTA PUBLIC SCHOOL COMPUTER APPLICATION(Pre Final) (Theory) (Two Hours) Answer to this paper must be written on the paper provided separately You will not be allowed to write during the first 15 minutes This time is to be spent in reading the question paper. The time given at the head of this paper is the time allowed for writing the answer ____________________________________________________________________________ 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 [ ] _______________________________________________________________________________________________________________________ CLASS:X SECTION A(40 Marks) Attempt all questions Question 1: a)What is null literal ? What is the default value of the null literal? [ 5* 2=10] b)Write the statement in java for c)What is exceptional handling? Name two block of exception handling. d)State the difference between if-else-if ladder and switch case e)if a=14; b=10;c=5 , Find the value of (Math.pow(++a) * ( Math .sqrt(b++) c )) Question 2: a)What is static and final variable in java? [ 5* 2=10] b)Write the advantages and disadvantages of an array ( two points each) c) Differentiate between throw and throws keywords. d)Find the value of Math.ceil(15.45) Math.floor(-11.5) e)What is the difference between a constructor function and a member function of a class? Question 3: [5*2=10] a)State the method that i)Converts a string to a primitive float data type ii)Determines if the specified character is an uppercase character b)What is the value of x and y when the following statements are executed ? int a=63, b= 36 Boolean x=(a>b)?true : false ; int y=(a<b)? a: b ; c) Differentiate between base class and derived class d) Define recursive function. Why it is useful in a program? e)What is the default value of byte, short, long and int ? Question 4: [ 5* 2=10] a)What is inheritance ? How is it useful in java? b) Differentiate between pure and impure function? c) What is an abstract method? What is the purpose of using keyword extends ? d) if String x= Computer ; String y= Application ; What do the following function return for i)System.out.println(x.substring(1,5); System.out.println(x.indexOf(x.charAt(4))); e)How are private members of a class different from public members? SECTION B( 60 Marks ) Attempt any four from this section. The answers this section should consist of the programs in either Blue J environment or any program environment with Java as the base. Each program should be written using variables descriptions/ Mnemonic Codes So that the logic of the program is clearly depicted. Flow chart and Algorithms are not required Question 5:Write a program in java to input a name and display in the following format e.g. Input name= Amit kumar Verma Ajay Yadav Output : Verma A K Yadav A [15] Question 6: A number is said to be unique if digits of a number are not repeated in it. Write a program to accept a number and check whether the number is Unique or not. [15] This program displays the message accordingly Sample Input : 5463 Sample output : It is a Unique number Sample Input : 327 Sample output : It is not a Unique number Question 7:Write a menu driven program to find the sum of the following series depending on the user choosing 1 or 2. 1)Sum= + + + ......... + [8] 2) Write a program in java to accept a number and check whether the number DISARIUM or not. itself A number is called Disarium if sum of its digits powered with their respective position is equal to the number e.g. Input n= 135 Output : Yes 1 1 + 3 2 +5 3 = 135 [7] Question 8: :Define a class taximeter having the following description Data members / instance variable : int taxino to store taxi number String name- to store passenger s name int km to store number of kilometers travelled Member functions: taximeter()- constructor to initialize taxino to 0 , name to and b to 0. input() to store taxino , name , km. calculate()- to calculate bill for a customer according to given condition Kilometers travelled (km) Rate/ km <=1 km Rs 25 1<km <=6 Rs 10 6<km<=12 Rs 15 12<km<=18 Rs20 >18 km Rs25 display()- to display the details in the following format Taxino Name Kilometers travelled Bill amount ------- ------- --------------------- ---------[15] Question 9: Write a program in java to calculate the volume of a cuboid , a cylinder and a cone as per User s choice a) Volume of a cuboid(v=l *b*h) 2 b) Volume of a cylinder( v= * r * h) 2 c) Volume of a cone( v=1/3* * r * h) Question 10: Write a program in java to store 5 words in a single Dimensional array and frame a new word by taking out the first character of each word. Arrange the alphabets of a new word in ascending order and display the resultant word. Sample Input :Eshita, Monalisha, Daniel, Kakoli and Sabita New word : EMDKS Sample output : DEKMS. //BEST OF LUCK // Prepared by Susanta Sasmal
|