Formatting page ...
ICSE Java class 10 Complete Reference COMPUTER APPLICATIONS (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 this question paper. The time given at the head of this Paper is the time allowed for writing the answers. This paper is divided into two sections. You are to answer 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[ ]. Section - A (40 Marks) Answer all the questions Question 1: (a) Differentiate between Primitive and Composite data type [2] (b) What are literals? Give any two types of literals. [2] (c) How Java is platform independent? Explain. [2] (d) What is unary operator? Give an example. [2] (e) Which search technique is most suitable for searching an element of the following array? Give the reason. Arr [ ] = {16, 32, 64, 128, 256, 512, 1024}; [2] Question 2: (a) Differentiate between break and continue statements in a loop. [2] (b) Write the output data type of the following functions (i) Math.rint(x); (ii) Character.isUpperCase(ch); [2] (c) Name the package that contains following class. (i) Random (ii) Math [2] Youtube Channel: ICSE Java Class 10 Complete Reference (d) Write the java statements to perform the following tasks: (i) To store middle index of an array called Name[ ] in the variable M. (ii) To convert the output data type of following expression to integer type. Math.sin(x)/2.31; [2] (e) Differentiate between pure and impure function. [2] Question 3: (a) If Z = 6, find the value of X and Z. { X = (5 * z++)% 4; Z = 'Z' +X; } [2] (b) What will be the output of the following java code for the following value of M: (i) M = 1500 (ii) M = 1000 String N = 2500-M >1000?"Eligible" : "Not eligible"; System.out.println(N); [2] (c) What will be the output of the following java statemets? (i) System.out.println( Goggle .lastIndexOf( G )); (ii) System.out.println("Tomorrow".concat(" Never Dies".toUpperCase())); [2] (d) Give the output of the following java code snippet. int ODD [] = {1, 35, 79, 81}; int L = ODD.length; int SA=0; for (int i = 0; i<L; i+=2) { SA += ODD [i]; } System.out.println(SA); [2] (e) Write java a statement to create a static method called Ticket which takes long type variable as it's argument and returns true or false. [2] (f) State one similarity and one difference between while loop and for loop. [2] (g) What is the need of a constructor in a class? Is constructor need to be created compulsorily by a programmer? [2] Youtube Channel: ICSE Java Class 10 Complete Reference (h) Consider following java snippet. Write a main method and write a statement to invoke ICSE() class ICSE { ICSE() { System.out.println("All the best for your Examination"); } } [2] (i) Convert the following java code using switch case if (ch == 'A' || ch == 'a') System.out.println("This is first letter "); else if(ch =='Z'|| ch== 'z') System.out.println("This is last letter "); else System.out.println("Other Character "); [4] Section - B (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 so that the logic of the program is clearly depicted. Flow-Charts and Algorithms are not required. Question 4: Write a program to accept a string and print the pattern given in the example: if given string is "STUDENT" then the pattern would be as given below S TT UUU DDDD EEEEE NNNNNN TTTTTTT Youtube Channel: ICSE Java Class 10 Complete Reference Question 5: Define a class called RIDER with the following description: Instance variables/data members: String Name to store the name of the customer long PhNo to store the Phone No of customer int D to store distance travelled in km int fare to calculate and store the charge Member methods: void get( ) to input and store the detail of the customer. void calc( ) to calculate the charge The fare is charged on the following basis. Basic fare 50 10 per km till 8 km 12 per km till 15 km 17 per km after 15 km void display ( ) to display the details in the following format: Name/ Phone No. / Distance travelled / Fare in Rupees call the above methods in the main method. [15] Question 6: Write a java program to accept a word, change it into uppercase, convert the word into an array of characters present in it, sort the array in alphabetical order and print sorted array & also print array after removing the duplicate elements. For example : if input word is "Occurrence", then output would be as given below: Sorted characters: CCCEENORRU After removing duplicate characters: CUREON [15] Question 7: Automatic Teller Machine accepts money while depositing and also dispenses the while withdrawing the money. Considering this write a menu driven program having the following menu. 1. Remittance Which accepts Account No. and cash in various denomination of currency in rupees (2000,500,200 & 100) and displays the total money remitted. 2. Withdraw Which accepts the Debit Card No., any four digit number as PIN & amount to withdraw. Then displays the denomination of cash dispensed from the ATM machine. Appropriate message should be displayed when user gives invalid input. [15] Youtube Channel: ICSE Java Class 10 Complete Reference Question 8: Write a java program to overload the method called Convert (i) which takes a String argument and converts reverse of uppercase and lowercase of alphabet present in the string. Example: if String is "10TH std examINation" then output should be: 10th STD EXAMinATION (ii) which takes character argument and prints its ASCII value. (iii) which takes integer argument and converts the sign of the given number (positive to negative or negative to positive) [15] Question 9: A Pronic number is a number which is the product of two consecutive integers. For example 30 is Pronic number because 5 * 6 = 30. Write a java class called Pronic_Number to input a number and check whether it is a Pronic Number or not and also display the two consecutive integers who's product is a given number if given number is Pronic number. Example input : 110 output : 110 is a Pronic number. Two consecutive numbers are: 10 & 11 [15] Youtube Channel: ICSE Java Class 10 Complete Reference
|