Trending ▼   ResFinder  

ISC Class XII Prelims 2020 : Computer Science (Vikas Bharti School, Gorakhpur) : ISC perboard

3 pages, 4 questions, 0 questions with responses, 0 total responses,    0    0
Vikas Bharti
  
+Fave Message
 Home > sanjeevvbs >

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] e) Write a prototype of a function accept which takes three arguments a string, afloat and a character and returns a double value. [2] f) Name the string function that removes the blank spaces provided in the prefix and suffix of the given string. [2] g) What are the values of a and b after the following function is executed? If the values passed are 30 and 50. [2] void pass(int a, int b) {a = a +b; b = a b; a = a b; System.out.println(a + , +b);} h) Write a statement to declare an integer array of 10 elements. [2] i) Evaluate the expression, if x=13.0 and Y=20.0 : [2] x+ = ++x + ++x +150*y+ ++y j) Differentiate between selection sort and bubble sort. [2] SECTION A (60 Marks) Attempt any four questions from this Section. The answers in 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 Variable descriptions/Mnemonic Codes such that the logic of the program is clearly depicted. Flow-Charts and Algorithms are not required. Question 4. Stock Exchange rates the company against points scored (out of 100) by the company over a period of month as per the following category. [15] Points Scored Grade Awarded Remark 0 20 D Poor for investment 21 50 C Average for investment 51 90 B Good for investment 91 100 A Best for investment Write a program in Java to design a class named Stock with the following descriptions: Class name : Stock Data members/ Instance Variables : CmpName : to store the name of company Points : to store the total points earned over the month Grd : to store the grade Rem : to store the remark Member functions: Stock( ) : parametrised constructor to assign company name and points earned through parameter and Grd = \u000 , rem = null void calculate( ) : to find the grade and remarks and assign them accordingly void display ( ) : to display all the details In the main method, create an object of the above class and call all the member function accordingly. Question 5. Write a menu driven program to perform the following (use switch statement): [15] Choice a : to print the series 0, 3, 8, 15, 24, .n terms (the value of n is to be input by the user) 1 3 5 7 19 Choice b : to find the sum of the series: S = 2 + 4 + 6 + 8 + + 20 Question 6. Write a program in java to input a sentence and print the number of characters found in the longest word of the given sentence. Example: String s= India is my country ; [15] Output : No. of character in the longest word = 7 Question 7. Write a program in java to input 6 elements in an array P, and 4 elements in other array Q, produce a third array R, containing all the elements of array P and Q. Display the resultant array. [15] Example: P[ ] = {3,6,9,12,78,908} Q[ ] = {23,56,89,67} R[ ] = {3,6,9,12,78,908, 23,56,89,67} Question 8. Vikas Travels Pvt. Ltd. Gives the following discount to its customers. Ticket Amount Discount Above 70000 18% 55001 to 70000 16% 35001 to 55000 16% 25001 to 35000 10% Less than 25001 5% [15] Write a program in java to input name and ticket amount from the user and compute the discount amount and net amount to be paid. Display the details in the following pattern: Name Ticket Amount Discount Amount Net Amount Question 9. A special two-digit number is such that the sum of its digits is added to the product of its digits, the result is equal to the original two-digit number. [15] Example: Two-digit number: 59 Sum of digits: 5 + 9 = 14 Product of digits: 5*9 = 45 Sum of the sum and the product: 14 + 45 = 59 Write a program in java to input a two-digit number and check whether it is a special two-digit number (as explained above) or not. Mock-Trials 2020/Form-A/SKG/019

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2025 ResPaper. Terms of ServiceContact Us Advertise with us

 

sanjeevvbs chat