Formatting page ...
VIKAS BHARTI SCHOOL BHARTIPURAM, GORAKHPUR Mock Trial 2019-20 Form A/Subject- Computer Application Time -2:00 Hrs/ Max.Marks-100 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 answers. This paper is divided into two sections. Attempt all questions from Section A and any four questions from Section B. The intended marks for question or parts of questions are given in the brackets [ ]. SECTION A (40 Marks) Attempt ALL questions Question 1: a) Why is a class known as composite data type? b) Write a statement each to perform the following: i. To store a number 285 as a string ii. To convert a string to a numeric value c) Give the output: String s = Indian , s1 = minds ; i. System.out.println(s.substring(0,2).concate(s1.substring(1))); ii. System.out.println( WH +(s.substring(2).toUpperCase()))); d) Give any two possible causes of compile-time error. e) Write down the equivalent if statement for the following: String grade = (mark > =90)? A : (mark >= 80)? B : C" Question 2: a) State the values of characteristic and mantissa when the following code is executed, String a = 4.3759 ; int n = s.indexOf( . ); int characteristic = Integer.parseInt(s.substring(0,n)); int mantissa = Integer.valueOf(s.substring(n+1)); b) State the types of error in the following statements: i. for(int i=1, i<10, i++) ii. System.out.println(Math.sqrt((-9)); c) What is the data type returned by the following functions: i. Math.log( ) ii. Character .toUpperCase( ) d) Write the significance of parametrised and non-parametrised constructors in Java. e) What is an exception? Name any two exception handling blocks. [2] [2] [2] [2] [2] [2] [2] [2] [2] [2] Question 3: a) What are identifiers? [2] b) Evaluate the value of n if the value of p=5, q=19 [2] int n = (q p) > (p q)?(q p) : (p q); c) Name the keyword which is used to resolve the conflict between method parameter and instance variables/fields. [2] + 2 4 )+ 2 d) Write java expression for z= cot ( + 2 4 ) 2 tan ( [2]
|