ICSE sample paper 2021 computer applications

                   

ICSE sample paper 2021 computer applications

JAVA videos

This paper is divided into two sections. You are to answer all the questions from section A, and any four from section B.

ICSE sample paper 2021 computer applications
SECTION A (40 Marks)

Attempt all questions    

    Q 1.                                                                                                       [5X2=10]

  1. Write an expression in Java for

C=M5 + A* |B|

  1. What are library classes? Give an example.
  2. Write one difference between constructor and method?
  3. Differentiate between Binary Search and Linear Search
  4. State the total size in bytes, of the arrays A[2] of double data type and B[4] of char datatype.

Q 2.                                                                                              [5X2=10]

  1. What is the result stored in M, after evaluating the following expression

int M=4; M=M++ – ++M + 2+ M–

  1. Differentiate between nextLine() and next() functions of scanner class. 
  2. Give the output of the following if n=8.57, m=-2.56
  1. Math.floor(n);
  2. Math.ceil(m);
  1. What is auto boxing? Explain with example. 
  2. Write one difference between public and protected access modifier.       

Q 3.                                                                                                                               [10X2=20]

  1. Assume that i=1, j=2, k=3 and m=2. What does each of the following statements print?  
  1. System.out.println(i+j >=k);
  2. System.out.println(!(k>m));
  1. What is an infinite loop? Write an infinite loop statement.        
  2. What are wrapper classes? Give the name of the function that converts a string into int. 
  3. Give the output of the following code: String P = “20”, Q =”19″; 

int a = Integer.parseInt(P);      int b = Integer.valueOf(Q); 

System.out.println(a+””+b);    

  1. If the value of basic=2500, what will be the value of incometax after the following  

statement is executed? 

incometax = basic>2000 ? 400 :100; 

  1. Give the output of following code and mention how many times the loop will execute? 

int i;  

for( i=15 ; i>=5 ;i–) 

if(i%2 ==1) 

continue; 

System.out.print( i+ ” ”); 

  1. Write the output for the following: 

String s1 = ”phoenix”; String s2 =”island” ; 

System.out.println (s1.substring(0).concat (s2.substring(2) ) ); 

System.out.println(s2.toUpperCase()); 

  1. String x[] = {“Artificial intelligence”, “IOT”, “Machine learning”, “Big data”}; [2] 

Give the output of the following statements: 

(i) System.out.println(x[1]); 

(ii) System.out.println(x[3].length); 

  1. Give the output of the following 

int a[]={1,3,5,7,9};

a[3]=a[1];

int b=a[0]+a[1];

System.out.println(b);

  1. int a= 5, b = 2,c; 

  if (a>b || a ! = b) 

      c = ++ a + –b; 

System.out.print(c+ “ ”+a+ “ ”+b);

ICSE sample paper 2021 computer applications
Section B (4X15= 60 marks)

Attempt any 4 questions out of 6

Q 4. Write a Menu driven Program to do the following

      a) Write a class to print the following series:      

S=a/x1+a/x2+a/x3+a/x4……. a/xn                                                [8]

      b) Write a class to display composite numbers from 1 to 100                                    [7]

Q 5                                                                                                                                     

A company has employees, who are divided into four grades depending on their Basic pay per month as follows,

Basic(Rs./month)     Grade        DA     HRA

10,001 or more         1        40%     30%
5,001 to 10,000         2        40%     25%
2001 to 5,000                  3        30%     20%
2,000 or less                     4        30%     15%

If the Net salary which is the total of Basic, DA, and HRA, is above Rs.50, 000 per month then Income Tax at the rate of 30% of the annual salary exceeding 50,000 is deducted on monthly basis. 

Taking name of the employee and the Basic (monthly) pay as inputs, prepare & print a pay slip, which contains Name, Grade, Basic monthly pay, DA, HRA, Monthly Income Tax and Net Monthly Salary, for employee.                                                                                                                 [15]

Q 6. 

Write a program to perform linear search on a list of integers given below, to search for an element input by the user, if it is found display the element along with its position, otherwise display the message “Search element not found”

1,2,4,6,8,90,120,56,234,400                                                             [15]

Q 7. 

Write a program in java to accept a sentence and find                     

  1. Number of blank spaces in the string
  2. Number of digits present in the string.
  3. Number of words in the string
  4. Number of characters present in the string                    [15]

Q 8. 

Write a program to accept a string. Convert the string to uppercase. Count and output the number of double letter sequences that exist in the string. 

Sample Input: Aarti bought a cotton shirt and butter from mall

output: 4

Q 9. 

Define a class named movieMagic with the following description: Instance variables/data members:

int yearto store the year of release of a movie
String titleto store the title of the movie.
float ratingto store the popularity rating of the movie.

  (minimum rating = 0.0 and maximum rating = 5.0)

Member Methods:

   (i)  movieMagic()              Default constructor to initialize numeric data members   to 0 and String data member to “”.

(ii) void accept()                To input and store year, title and rating.

(iii) void display()            To display the title of a movie and a message based on the rating as per the table below.

RatingMessage to be displayed
0.0 to 2.0Flop
2.1 to 3.4Semi-hit
3.5 to 4.5Hit
4.6 to 5.0Super Hit

Write a main method to create an object of the class and call the above member methods. ICSE sample paper 2021 computer applications

Revision for class x

LEAVE A REPLY

Please enter your comment!
Please enter your name here