ICSE Class 10 Computer Applications ( Java ) 2017 Solved

Question Paper

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

ICSE Question Paper – 2017 (Solved)
Computer Applications
Class X

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

SECTION A (40 MARKS)
Attempt all questions


Question 1:
a) What is Inheritance ? [2]

Ans. Inheritance is the process by which one class extends another class to inherit the variables and functions and add any additional variables and methods.

b) Name the operators listed below [2]

i) < ii) ++ iii) && iv) ?:
Ans.

i) Less than comparison operator
ii) Increment operator
iii) And logical operator
iv) Ternary operator

c) State the number of bytes occupied by char and int data types.[2]
Ans. char occupies two bytes and int occupied 4 bytes.

d) Write one difference between / and % operator. [2]
Ans. / is division operator while % is modulus operator which gives the remainder on dividing two numbers.

e) String x[] = {“SAMSUNG”, “NOKIA”, “SONY” , “MICROMAX”, “BLACKBERRY”};
Give the output of the following statements:[2]
i) System.out.println(x[1]);
ii) System.out.println(x[3].length());
Ans. i) NOKIA
ii) “MICROMAX”.length() = 8

Question 2:
a) Name of the following: [2]
i) A keyword used to call a package in the program.
ii) Any one reference data types.
Ans. i) import
ii) String

b) What are the two ways of invoking functions? [2]
Ans. Call by value and call by reference

c) State the data type and value of res after the following is executed : [2]

char ch = ‘t’;
res = Character.toUpperCase(ch);
Ans. Data type of res is char and value is T

d) Give the output of the following program segment and also mention the number of times the loop is executed: [2]

Ans.

Loop initialization: a = 6, b = 4

First iteration:
Condition check: a <= 24 that means (6 <= 24) , which is true
Loop is executed for the first time
Loop execution: a % b = 6 % 4 = 2 != 0 Hence, break is not executed
Loop increment operator: a = a + 6 that means ( a = 6 + 6 ),  then a is updated to 12

Second iteration:
Condition check: a <= 24 that means (12 <= 24) , which is true
Loop is executed for the second time
Loop execution: a % b = 12 % 4 = 0 = 0 Hence, break is executed
System.out.println(a); This statement will print 12

Output is 12 and loop is executed two times

e) Write the Output: [2]

Ans. ch = ‘F’
int m = ch; From this statement  ASCII value of ‘F’ i.e. 70 will be assigned to m
m = m + 5 = 70 + 5 = 75
System.out.println(m+ ” ” +ch); & this statement will print 75 F
Output is 75 F

Question 3:
a) Write a Java expression for the following : [2]

ax5 + bx3 + c
Ans. a * Math.pow(x, 5) + b * Math.pow(x, 3) + c

b) What is the value of x1 if x=5 ? [2]
x1=++x – x++ + –x
Ans. x1=++x – x++ + –x
x1 = 6 (x is incremented to 6) – 6 (x is incremented to 7) + 6 (x is decremented to 6)
= 6

c) Why is an object called an instance of a class? [2]
Ans. An object is called an instance of a class as every object created from a class gets its own instances of the variables defined in the class. Multiple objects can be created from the same class.

d) Convert following do-while loop into for loop. [2]

Ans.

e) Differentiate between constructor and function. [2]

Ans. The constructor of a class is invoked automatically during object creation while a function is invoked manually after object creation.
A constructor is invoked only once while a function can be invoked multiple times.
A constructor has the same name as the class in which it is defined while a function can have any name.

f) Write the output for the following: [2]

Ans.
So the first println method , System.out.println(s.indexOf(‘T’)); will print the index of T, which is 0 (zero)
& second println method will take substring stored from 0 to 7th index & concatenate it with  a String “Holiday”
“Today i” + ” ” + “Holiday”
“Today i Holiday”
Output is
0
Today i Holiday

g) What are the values stored in variables r1 and r2: [2]

i) double r1 = Math.abs(Math.min(-2.83,-5.83));
ii) double r2 = Math.sqrt(Math.floor(16.3));
Ans. i) double r1 = Math.abs(Math.min(-2.83,-5.83));
= Math.abs(-5.83)
= 5.83
ii) double r2 = Math.sqrt(Math.floor(16.3));
= Math.sqrt(16)
= 4.0

h) Give the output of the following code: [2]

Ans.
String A= “26″, B= “100″ ;
A = “26″, B = “100″

String D=A+B+ “200″;

By doing this, value of A will concatenate with value of B & further these are concatenated with String “200”
So , D = “26″ + “100″ + “200″ = 26100200

int x= Integer.parseInt(A);
x = Integer.parseInt(“26″) , By doing this String “26” will converted into Integer 26 , and it will be assigned into variable x

int y=Integer.parseInt(B);
y= Integer.parseInt(“100”) , Similarly String “26” will be converted into Integer 26 , and it will be assigned into variable y

int d=x+y;
d = 26 + 100 = 126

System.out.println(“Result 1=” +D);
Result 1=26100200

System.out.println(“Result 2=”+d);
Result 2=126

Output is

i) Analyze the given program segment and answer the following questions [2]

i) How many times does the inner loop execute ?
ii) Write the output of the program segment.

Ans. The output loop runs twice, with i = 3 and i = 4
When i = 3, the inner loop runs once with j = 2
When i = 4, the inner loop runs twice with j = 2 and j = 3

i) Inner loop executes 3 times
ii)

j) What is the difference between the Scanner class functions next() and nextLine()? [2]

Ans. next() read a single token i.e. all characters from the current position till a whitespace or tab or new line is encountered.
nextLine() reads an entire line i.e. all characters from the current position till a new line is encountered.

 

SECTION B (60 Marks)
Attempt any four questions from this Section.
The answers in this section should consist of the programs in either BlueJ environment or any program environment with Java as the base.
Each program should be written using Variable descriptions/Mneumonic codes so that the logic of the program is clearly depicted.
Flow-charts and algorithms are not required.

 

Question 4.
Define a class Electric Bill with the following specifications: [15]

class: ElectricBill
Instance Variable/ data member:
String n – to store the name of the customer
int units – to store the number of units consumed
double bill – to store the amount to paid
Member methods:
Void accept() – to accept the name of the customer and number of units consumed
Void calculate() – to calculate the bill as per the following tariff :
Number of units — Rate per unit
First 100 units — Rs.2.00
Next 200 units — Rs.3.00
Above 300 units — Rs.5.00
A surcharge of 2.5% charged if the number of units consumed is above 300 units.
Void print() – To print the details as follows :
Name of the customer ………
Number of units consumed ……
Bill amount …….
Write a main method to create an object of the class and call the above member methods.

Ans.

Sample output

Question 5. Write a program to accept a number and check and display whether it is a spy number or not. [15]

(A number is spy if the sum its digits equals the product of the digits.)

Example: consider the number 1124 , sum of the digits = 1 + 1 + 2 + 4 = 8 Product of the digits = 1 x 1 x 2 x 4=8

Ans.

 

Sample output 1

Enter number: 1124
Spy number

Sample output 2

Enter number: 1254
Not a spy number

Question 6.
Using switch statement, write a menu driven program for the following: [15]
i) To find and display the sum of the series given below:
S = x1 – x2 + x3 – x4 + x5 … – x20
(where x=2)
ii) To display the following series:
1 11 111 1111 11111
For an incorrect option, an appropriate error message should be displayed.

Ans.

Sample output 1

Press 1 for Sum of series
Press 2 for Display Series
Enter your choice: 1
Sum = -699050.0

Sample output 2

Press 1 for Sum of series
Press 2 for Display Series

Enter your choice: 2
1 11 111 1111 11111

Sample output 3

Press 1 for Sum of series
Press 2 for Display Series
Enter your choice: 3
Invalid choice

Question 7.
Write a program to input integer elements into an array of size 20 and perform the following operations: [15]
i) Display largest number from the array
ii) Display smallest number from the array
iii) Display sum of all the elements of the array

Ans.

Sample output

Enter 20 numbers: 1 2 3 4 5 6 7 8 9 8 5 4 2  4 5 6 8 4 7 82

Smallest = 1
Largest = 82
Sum = 245

Question 8:
Design a class to overload a function check() as follows:
i) void check(String str, char ch) – to find and print the frequency of a character
in a string.
Example :
Input — Output
Str = “success” number of s present is=3
ch = ‘s’
ii) void check (String s1) – to display only the vowels from string s1 , after converting it to lower case.
Example :
Input: S1= “computer”

output: o u e

Ans.

Question 9:
Write a program to input forty words in an array. Arrange these words in descending order of alphabets, using selection sort technique. Print the sorted array.

Ans.

ICSE Class 10 Computer Applications 2017 Solved Question 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

    4 thoughts on “ICSE Class 10 Computer Applications 2017 Solved Question Paper

    • March 18, 2019 at 12:46 pm
      Permalink

      sir question 2 e ans is i think wrong because small is 70 but small a starts from 97

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

        No Asim , ASCII value of Capital ‘F’ is 70

        Remember :
        Ascii for A-Z is from 65 to 90
        & for a-z is from 97 to 122

        Reply
        • March 19, 2019 at 10:49 pm
          Permalink

          yes sir i have seen i was bit confused i forgot ht u have stored “F” in ch then u hvave added

          Reply
          • August 21, 2019 at 8:50 pm
            Permalink

            yeah ? , Hey Asim we’re uploading today’s (ICSE 10th Computer Applications 2019 Solved ) Paper by tomorrow 12 to 2 pm, you will be notified, Please do share with your friends

            Reply

    Leave a Reply

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