Sunday, 24 March 2024

ICSE COMPUTER APPLICATION PAPER - SOLVED 2023-24 : Mukul Sir Notes

 ICSE 

2023-24 Paper

COMPUTER APPLICATION SOLUTION

-----------------------------------------------------------------------------------------------------------

Maximum Marks:100

Time Allowed : Two Hours

Answer s to this paper must be written on the provided separately.

You will not 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 on this Paper is the time allowed for writing the 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 questions or parts of questions are given in brackets[].

------------------------------------------------------------------------------------------------------------------


SECTION - A 

Question 1.

Consider the above picture and choose the correct statement from the following

(i) Consider the above picture and choose the correct statement from the following:

(a) Polygon is the object and the pictures are classes
(b) Both polygon and the pictures are classes 
(c) Polygon is the class and the pictures are objects
(d) Both polygon and the pictures are objects. 

Ans: (c) Polygon is class and pictures are objects

(ii) int x=98; char ch=(char)x; what is the value in ch?
(a)     b                         (b)    A                         (c)    B                    (d)    97

Ans: (c) B
 
(iii) The output of the statement "CONCATINATION".indexOf() is:
(a)     9                         (b)    7                         (c)    6                    (d)    (-1)
Ans: (c) 6

(iv) The access specifier that gives least accessibility is:
(a)     package             (b)    public                 (c)    protected        (d)    private
Ans:  (d) private 

(v) The output of the statement "tallent".compareTo("genius") is:
(a)     11                       (b)    -11                     (c)    0                    (d)    13 
Ans: (d) 13 

(vi) Which of the following is an escape sequence character in Java?
(a)     /n                       (b)    \t                         (c)    /t                    (d)    //n 
Ans: (b) \t 

(vii) If (a>b && b>c) then largest number is:
(a)     b                         (b)    c                         (c)    a                    (d)    wrong expression
Ans: (c) a 

(viii) What is the output of Math.ceil(5, 4)+ Math.ceil(4, 5)?
(a)     10.0                    (b)    11.0                    (c)    12.0               (d)    9.0
Ans: (b) 11.0 
 
(ix) What is the method to check whether a character is a letter or digit?  
(a) isDigit(char)
(b) isLetterOrDigit()
(c) isLetterOrDigit(char)
Ans: (b) isLetterOrDigit()
 
(x) The extension of a Java source code file is:
(a)     .exe                    (b)    obj                    (c)    jvm               (d)    java
(d) java 

(xi) The number of bytes occupied by a cha 
Ans: (a) 12 ( 1 char uses 1 Byte [4 rows x 3 Column] = 12 therefore 12 bytes 

(xii) Which of the following data type cannot be used with switch case connect?
(a)     int                        (b)    char                (c)    String             (d) double
Ans: (d) double 

(xiii) Which of the following are entry controlled loops?
1. for
2. while 
3. do..while
4. switch
(a)     only 1                   (b)    1 and 2           (c)  1 and 3             (d) 3 and 4
Ans: (b) 1 and 2 

(xiv) Method which reverse a given number is :
(a)    Impure methods
(b)    Pure method
(c)    Constructor
(d)    Destructor
Ans: (a) Impure method (cause impure method changes value (reversing is changing value) 

(xv) If the name of the class is 'Yellow", what can be the possible name of its constructors?
(a)    yellow 
(b)   YELLOW
(c)    Yell
(d)    Yellow
Ans:  (d) Yellow (Class name is same as Constructor name) 

(xvi) Invoking a method by passing the objects of a class is termed as:
(a) Call by reference 
(a) Call by value
(a) Call by method 
(a) Call by constructor 
Ans: (a) Call by reference 

(xvii) The correct statement to create an object named mango of class fruit:
(a)   Fruit Mango=new fruit(); 
(b)   fruit mango=new fruit();
(c)   Mango fruit=new Mango();
(d)   fruit Mango=new mango();
Ans: (b) fruit mango=new fruit(); 

(xviii)  Assertion(A) : Static access can access static and instance variables.    
            Reason(A) : Static variable can be access only by static method.
(a) Assertion and Reason both are correct.   
(a) Assertion is true and Reason is false.
(a) Assertion is false and Reason is true. 
(a) Assertion and Reason both are false.
Ans: (c) Assertion is false and Reason is true 

(xix) What is the output of the Java code given below?
String color[]={"Blue", "Red",  "Violet"}; 
System.out.println(color[2].length());
(a)     6                         (b)    5                         (c)    3                    (d)    2
Ans: (a) 6 

(xx) Which of the following mathematical methods returns only an integer? 
(a) Math.ceil(n)
(b) Math.sqrt(n) 
(c) Math.floor(n) 
(d) Math.round(n)  
Ans: (d) Math.round();  

Question 2.

(i) Write Java expression for:

Ans: Math.abs(a+b)/Math.sqrt(a*a+b*b)

(i) Evaluate the expression when x is 4:

x+=x++ * ++x%2;

Solution:  x+=x++ * ++x%2;

which is x= x + x++ * ++x%2 

Here x=4

x= 4 + 4 x 5%2;

x= 4 + 4 x 1

Ans: x=8;

(iii) Rewrite the following do while program segment using for: 

x=20; y=20;

do

{

      x++;

      y++;

}while(x<=20);

System.out.println(x*y);


(ii) Evaluate the expression when x is 4 :

x+=x++ * ++x +x%2;

 = 4 + 4*6%2

 = 4 + 0

 = 4

(iii) for(x=10, y=20;x<=20;x++,y++)

(iv) infinite loop , No Output

(v) x=100

(vi) (a) Order of the array. 

 4                     3                     2

(0, 0)            (0, 1)              (0 ,2)

 7                     8                     2

(1, 0)             (1, 1)             (1 ,2)

 8                     3                     10

(2, 0)             (2, 1)             (2 ,2)

 1                     2                     9

(3, 0)             (3, 1)             (3 ,2)

So solution is x[0][0] + x[2][2] =14+10=24

(vii) Boxing and Unboxing

Boxing is the process of converting a primitive datatype into an object wrapper datatype, and 

unboxing is the process of converting a value from an object wrapper type back to the native 

primitive value. Further on, we can say that both boxing and unboxing operations are a 

subset of typecasting.

(viii) String a="KING",    b="KINGDOM";

System.out.println(a.compareTo(b)); Answer is false

(ix) Here the concept is Constructor overloading

First Constructor is default Constructor

Second is Parameterized Constructor.

(x) (a) java.lang

(b) import java.util.* ; statement is required to access Scanner Class

SECTION B

Question 3:

Solution:-

import java.util.*;

public class courier 

{

    String name;

    double weight;

    String address;

    double bill;

    char type;

    public void accept()

    {

             Scanner sc=new Scanner(System.in);

                System.out.println(“Enter Name of Customer:”);

                name=sc.nextLine();

                System.out.println(“Enter Weight of Parcel in kilogram:”);

                weight=sc.nextDouble()

System.out.println(“Enter Address of Recipient:”);

Address=sc.nextLine()

System.out.println(“Enter Type D-Domestic I-International :”);

type=(char) sc.next().charAt(0);

}

public void calculate()

{

 if(weight<=5)

 {

 bill=weight*8.00;

 }

 else if(weight<=10)

 {

 bill=5*8+(weight-5)*7.00;

 }

 else if(weight>10)

 {

 bill=5*8.00+5*7.00+(weight-5)*5.00;;

 }

public void print()

if(type==’D’)

 {

System.out.println(“Bill : “+bill);

 }

 if(type==’I’)

 {

 Bill=bill+1500;

System.out.println(“Bill : “+bill);

 }

}

Question 4:

Solution:-

public class perform

{

public perform(double r, double h)

{

 double l=Math.sqrt(r*r+h*h); 

 double CSA= pi*r*l;

 System.out.println (”Curved Surface Area :”+CSA);

public perform(int r, int c)

{

 for(int i=1;i<=r;i++)

 {

 for(int j=1;j<=c;j++)

 {

 System.out.print(c+ “ “);

 }

 System.out.println();

public perform(int m, int n,char ch)

{

 if(ch==’R’)

 System.out.println (m%n);

 if(ch==’Q’)

 System.out.println (m/n);

 }

}

Question 5:

Solution:-

Import java.util.*;

public class EvenPal

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

int no=0,sum=0,rev=0;

System.out.println (“Enter Number”);

no=sc.nextInt();

int actno=no;

while(n>0)

{

int p=no%10;

rev=rev*10+p;

no=no/10;

}

sum=0;

if(rev==actno)

{

 while (rev>0)

 {

 int p=rev%10;

 sum=sum+p;

 rev=rev/10;

 }

 }

if(sum%2==0)

{

System.out.println(“EvenPal Number”);

}

else

{

System.out.println(“Not an EvenPal Number”);

}

}

}

Question 6: 

Solution:-

import java.util.Scanner;

public class DiagonalMatrix

{

private static boolean checkDiagonalMatrix(int[][] matrix){

 for(int i=0; i<matrix.length;i++)

 for(int j=0; j<matrix[i].length;j++){

 if((i == j && matrix[i][j] == 0) || (i != j && matrix[i][j] != 0)) return false;

 }

 return true;

 }

 }

}

Question 7: 

Solution:-

public class SelectionSort{ 

 public static void main(String args[])

 {

 int arr[]={110061, 110001, 110029, 110023, 110055, 110006, 110019, 110033};

 

 for (int i = 0; i < arr.length - 1; i++) 

 { 

 int index = i; 

 for (int j = i + 1; j < arr.length; j++){ 

 if (arr[j] < arr[index]){ 

 index = j;//searching for lowest index 

 } 

 } 

 int smallerNumber = arr[index]; 

 arr[index] = arr[i]; 

 arr[i] = smallerNumber; 

 } 

System.out.println("Sorted Values are...n"); 

for (int i = 0; i < arr.length - 1; i++) 

{

System.out.print(arr[i]+","); 

}

Question 8:

Solution:-

import java.util.*;

public class ValidMail

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

 String mail=new String(“”);

System.out.println(“Enter an Email Address: “);

mail=sc.nextLine();

if(mail.indexOf(“@”)>=0)

{

 System.out.println(“Yes it is a Valid Email!”);

}

if(mail.indexOf(“.”)>=0)

{

 System.out.println(“Yes it is a Valid Email!”);

}

if(mail.compareOf(“gmail”)>=0)

{

 System.out.println(“Yes it is a Valid Email!”);

}

}

}

}}



No comments:

Post a Comment

CLASS X TYPES OF NUMBERS

 CLASS X  TYPES OF NUMBERS List of types of Numbers 1. Arm Strong Number 2.  Co-prime Number 3. Duck Number [I.C.S.E 2024] 4. Magic Number  ...