ICSE Class 10 Computer Applications 2018 Solved Paper

ICSE Class 10 Computer Applications 2018 Solved Question Paper

If you have any doubts, ask them in the comments section at the bottom of this page.

ICSE Class 10 Computer Applications 2018 Solved Paper
Computer Applications
Class X

SECTION A (40 Marks)
Answer all questions from this Section

SECTION A (40 MARKS)
Attempt all questions

Question 1:
(a) Define abstraction. [2]

Ans. Abstraction refers to specifying the behaviour of a class without going into the details of the implementation.

(b) Differentiate between searching and sorting. [2]

Ans. In searching, we are provided with an array which contains multiple elements and asked to find the index of a specific element.
In sorting, an array is provided and we are asked to order the elements in either ascending or descending order.

(c) Write a difference between the functions isUpperCase() and toUpperCase(). [2]

Ans. Both isUpperCase() and toUpperCase() are functions of the Character class.
isUpperCase() accepts a character and returns true if the provided character is uppercase. Else, it returns false.
Ex:

will print

(d) How are private members of a class different from public members? [2]

Ans. Private members of a class can be accessed only by the methods of the class in which they are declared. While public members can be accessed outside of the class also.

(e) Classify the following as primitive or non-primitive data types: [2]
(i) char
(ii) arrays
(iii) int
(iv) classes

Ans. (i) char – Primitive
(ii) arrays – Non primitive
(iii) int – Primitive
(iv) Classes – Non proimitive

Question 2
(a) (i) int res = ‘A’;
What is the value of res?
(ii) Name the package that contains wrapper classes. [2]

Ans. (i) res will hold the ASCII value of ‘A’ which is 65.
(ii) java.lang package contains wrapper classes.

(b) State the difference between while and do-while loop. [2]

Ans. A while is an entry controlled loop i.e. the loop condition is checked before the loop is executed while do-while is an exit controlled loop i.e. the loop condition is checked after the loop is executed.
Because of this a do-while loop gets executed atleast once which is not true for a while loop.

(c) System.out.print(“BEST “);
System.out.println(“OF LUCK”);
Choose the correct option for the output of the above statements: [2]
(i) BEST OF LUCK
(ii) BEST
OF LUCK
Ans. (i) is the correct output.
System.out.print() does not add a new line at the end because of which ‘OF LUCK’ gets printed on the same line as ‘BEST’.

(d) Write the prototype of a function check which takes an integer as an argument and returns a character. [2]
Ans.

(e) Write the return data type of the following functions: [2]
(i) endsWith()
(ii) log()

Ans. i) boolean
ii) double

Question 3
(a) Write a Java expression for the following: [2]
(3x + x²) / (a + b)

Ans. Math.sqrt(3 * x + Math.pow(x, 2)) / (a + b)

(b) What is the value of y after evaluating the expression given below? [2]
y += ++y + y– + –y; when int y = 8.
Ans.
y += ++y + y– + –y
y = 8 + ++y + y– + –y
y = 8 + 9 + 9 + 7
y = 33

(c) Give the output of the following: [2]
(i) Math.floor(-4.7)
(ii) Math.ceil(3.4) + Math.pow(2, 3)

Ans. i) -5.0
ii) 4.0 + 8.0 = 12.0

(d) Write two characteristics of a constructor. [2]

Ans. i) A constructor has the same name as that of the class
ii) A constructor does not have a return type

(e) Write the output for the following: [2]
System.out.println(“Incredible” + “\n” + “world”);
Ans.

(f) Convert the following if else if construct into switch case: [2]

Ans.

 

(g) Give the output of the following string functions: [2]
(i) “ACHIEVEMENT”.replace(‘E’, ‘A’)
(ii) “DEDICATE”.compareTo(“DEVOTE”)

Ans. i) ACHIAVAMANT
ii) The first two characters are same. So, we take the ASCII values of the third characters and subtract to get the result.
D – V = 68 – 86 = -18

(h) Consider the following String array and give the output: [2]

Ans.
System.out.println(arr[0].length() > arr[3].length());
arr[0].length() > arr[3].length()
“DELHI”.length() > “LUCKNOW”.length()
5 > 7 , which is false
Output is false

System.out.print(arr[4].substring(0, 3));
JAIPUR.substring(0, 3)
JAI
Output is JAI

(i) Rewrite the following using ternary operator: [2]

Ans.

(j) Give the output of the following program segment and also mention how many times the loop is executed: [2]

Ans.
Loop condition i > 10 evaluates to 5 > 10 which is false. So, loop is not executed even once
System.out.println(i * 4) prints 5 * 4 = 20

SECTION B (60 Marks)

ICSE Class 10 Computer Applications 2018 Solved Paper
Attempt any four questions from this Section.

 

Question 4
Design a class RailwayTicket with the following description:
Instance variables/data members:
String name: to store the name of the customer.
String coach: to store the type of coach customer wants to travel.
long mobno: to store customer’s mobile number.
int amt: to store basic amount of ticket.
int totalamt: to store the amount to be paid after updating the original amount.
Methods:
void accept(): to take input for name, coach, mobile number and amount.
void update(): to update the amount as per the coach selected. Extra amount to be added in the amount as follows:

Type of coaches Amount
First_AC 700
Second_AC 500
Third_AC 250
sleeper None
void display(): To display all details of a customer such as name, coach, total amount and mobile number.
Write a main() method to create an object of the class and call the above methods.

Ans.

Sample output:

Question 5
Write a program to input a number and check and print whether it is a Pronic number or not. Pronic number is the number which is the product of two consecutive integers.
Examples:
12 = 3 × 4
20 = 4 × 5
42 = 6 × 7

Ans.

Sample output

Question 6
Write a program in Java to accept a string in lowercase and change the first letter of every word to uppercase. Display the new string.
Sample INPUT: we are in cyber world
Sample OUTPUT: We Are In Cyber World
Ans.

Sample output

Question 7 Design a class to overload a function volume() as follows:

(i) double volume(double r) – with radius ‘r’ as an argument, returns the volume of sphere using the formula: v = 4 / 3 × 22 / 7 × r³

(ii)double volume(double h, double r) – with height ‘h’ and radius ‘r’ as the arguments, returns the volume of a cylinder using the formula: v = 22 / 7 × r² × h

(iii) double volume(double l, double b, double h) – with length ‘l’, breadth ‘b’ and height ‘h’ as the arguments, returns the volume of a cuboid using the formula: v = l × b × h

Ans.

Question 8 Write a menu-driven program to display the pattern as per user’s choice:

Pattern 1        Pattern 2

ABCDE           B

ABCD              LL

ABC                 UUU

AB                    EEEE

A

For an incorrect option, an appropriate error message should be displayed.

Ans.

 

Sample output 1

Sample output 2

Sample output 3

Question 9
Write a program to accept name and total marks of N number of students in two single subscripts array name[] and totalmarks[].

Calculate and print:
(i) The average of the total marks obtained by N number of students.
[average = (sum of total marks of all the students) / N]
(ii) Deviation of each student’s total marks with the average.
[deviation = total marks of a student – average]

Ans.

Sample output

Checkout 10 years Solved Question Papers ICSE 10 Years Solved Papers
Download Question Paper

ICSE Class 10 Computer Applications 2018 Solved Paper

Editorial Staff

Editorial Staff at TCA is a team of Programmers led by Shubham Tripathi. Trusted by over 100K readers worldwide

    See all posts by shubham

    10 thoughts on “ICSE Class 10 Computer Applications 2018 Solved Paper

    • March 17, 2019 at 5:35 am
      Permalink

      In question number 6 can programing be done by using while loop

      Reply
      • March 17, 2019 at 8:36 pm
        Permalink

        Yes u can but using for loop will save lots of time

        Reply
    • March 17, 2019 at 12:12 pm
      Permalink

      Why you have again created a class in question no 4 line 42

      Reply
      • March 17, 2019 at 12:21 pm
        Permalink

        Hey Shriyanshi, since in question it is asked to create an object of a RailwayTicket class, So if we define our main method within same class, then we don’t need to call the method by object of the class in which these methods (accept, update, display) belongs to.
        So in order to call any non-static method of a class , we need to first create an object of the class in which these methods are defined

        Reply
    • March 17, 2019 at 6:37 pm
      Permalink

      any one refrence data type?

      Reply
    • March 18, 2019 at 8:41 pm
      Permalink

      sir how to check for twisted prime

      Reply
      • March 18, 2019 at 9:42 pm
        Permalink

        Reply
    • September 26, 2019 at 9:09 pm
      Permalink

      how to split words from a sentence

      Reply
      • September 26, 2019 at 9:12 pm
        Permalink

        will you elaborate you question ??

        Reply

    Leave a Reply

    Your email address will not be published. Required fields are marked *