Solved 2024 ICSE Computer Applications Class X Boards Paper - "perform()" Overloading

Solved 2024 ICSE Computer Applications Class X Boards Paper - "perform()" Overloading

Photo by Andrew Neel on Unsplash

In this article we see the solution of Question 6. of Section B.

The solution would be simple, as per syllabus standard not very much abstracted and verbose but it will pretty straight forward.

You can easily copy the code by clicking on copy button mentioned on top right or simply by ctrl A and ctrl C.


class Overload
{
    void perform(double r, double h)
    {
        double l=Math.sqrt(r*r+h*h);
        double CSA = Math.PI*r*l;
        System.out.println("CSA="+CSA);
    }

    void perform(int r, int c)
    {
        for(int i=1;i<=r;i++)
        {
            for(int j=1;j<=c;j++)
            {
                System.out.println(j+" ");
            }
            System.out.println();
        }
    }

    void perform(int m,int n,char ch)
    {
        if(ch=='Q')
        {
            System.out.println(m/n);
            System.out.println(n/m);
        }
        else
        {
            System.out.println(m%n);
            System.out.println(n%m);
        }

    }
}

If you have any questions or want to share your answer you wrote during the paper, please do so in the comments.

Follow Ayush Vanvary

Instagram- vanvaryclasses.in