Sample PapersICSEClass 10Computer Applications

ICSE sample paper 2021 for class X JAVA

ICSE sample paper 2021 for Class 10 Java: ICSE Class 10 Computer Applications sample paper with important questions for computer exam practice.

Updated
Sample Papers

Click for java videos

ICSE sample paper 2021

Download the paper

ICSE Class 10 Sample Paper

PDF · 84 KB

Download PDF
Read the questions as text
Class: X Subject: Computer This paper is divided into two sections. You are to answer all the questions from section A, and any four from section B. Section A (40 marks) 1. a. Give the output of the following. i. “CHEER”.replace(“E”,”I”); ii. “TEAR”.compareTo(“FEAR”); b. Write a one line statement using appropriate function which checks whether the character ch is a whitespace character or not? c. Convert the following into for loop. int i=10, x=1; do { i++; x++; System.out.println(x), } while(x<=10); d. Arrange the following primitive data types in an ascending order of their size: (i) char (ii) byte (iii) double (iv) int e. Write the return type of random() and trim() 2. a. Explain any one primitive and one non primitive data type. b. Write a java statement for the following expression. double b=(1/sin x )+cos y c. Explain any two jump statements. d. Write a statement using library function to 1. Check if a character ch1 is a digit, store the result in variable ans 2. Find the smallest number out of two integers x and y, store the result in c. e. Write a function prototype of a function Check that takes a float and an integer type of arguments and returns a boolean value. 3. A. State the output of the following expression when x=-10, y = 81; System.out.println((Math.pow(Math.abs(x),3))*Math.sqrt(y)); B. Assume that i=1, j=2,k=3and m=2.What does each of the following statements print? 1. System.out.println(k+m>=k); 2. System.out.println(! (k>m)); C. Write any two characteristics of a constructor. D. what would be the value of x after evaluating the following expressions given below? X-=(X--)-(--X + X++) where X is given as 8. E. Create a class Ten with one integer variable and one String variable. Initialize the instance variables using : default constructor and parameterized constructor F. Convert the following if..else code to switch if(n==1 ||n==0) X++; if(n==5) X+=5; else X=100; G. Give the difference between sqrt() and max() function. H. Give the output of the following code. a. System.out.println(“Malayalam”.indexOf(‘a’)+ “Malayalam”.lastIndexOf(‘a’)); b.System.out.println(“Physics”.substring(0,5).concat(“Geography”.sub string(2)); I. Write the output of following program code: char ch; int x=65; do { ch = (char)x; System.out.println(ch + " "); if(x % 10 == 0) break; ++X; } while(x<=75); J. What will be the output of the following code. 1. System.out.println("MONDAY". substring (3)); 2. System.out.println("WONDERFUL". substring (3,4)); Section B (60 marks) Attempt any 4 questions out of 6 4. Write a menu driven program to perform the following operations 1. Reverse the word 2. Print the letters of the words in the following patterns For incorrect choice, an appropriate message should be displayed. M MO MON MONE MONEY (if the word entered is "MONEY") [15] 5. Accept any string, replace all the vowels with the next alphabet in the string. EXAMPLE INPUT : NASIR UMER OUTPUT : NBSJR VMER [15] 6. A number that is smaller than the sum of its factors excluding the highest factor is said to be an abundant number: Example: Number 12, Sum of its factors excluding the highest factor = 1+2+3+1+6=16 6. Write a program to print all abundant numbers in the range 1 to n (both inclusive) where n is to be accepted in the program. Print the output with the appropriate message. [15] 7. Write a Menu driven Program to do the following a) To print the following series: S= 1/1! + 2/2! + 3/3! + …N/N!. [8] b) To display palindrome numbers between 1 to 100 [7] 8. Design a class named ShowRoom with the following description: Instance variables/data members: String name: to store the name of the customer. long mobno: to store the mobile number of the customer. double cost: to store the cost of the items purchased. double dis: to store the discount amount. double amount: to store the amount to be paid after discount. Member methods: ShowRoom(): default constructor to initialize data members. void input(): to input customer name, mobile number, cost. void calculate(): to calculate discount on the cost of purchased items, based on the following criteria: COST DISCOUNT (IN PERCENTAGE) Less than or equal to Rs. 10000 5% More than Rs. 10000 and less than or equal to Rs. 20000 10% More than Rs. 20000 and less than or equal to Rs. 35000 15% More than Rs. 35000 20% void display(): to display customer name, mobile number, amount to be paid after discount. Write a main() method to create an object of the class and call the above member methods. [15] 9. Define a class to overload a function check() as follows: void check(int,int)- To check and print if the first int is divisible by Second or not, with an appropriate message: void check(char,char) -To check the numeric values of both the characters and print the character with higher numeric values. void check(String,char) - To check and print the number of times the character occurs in the string. Write the main method to call the above methods. [15]