## ICSE 10th Computer Applications 2019 Solved Paper # ICSE 10th Computer Applications 2019 Solved Paper

## ICSE 10th Computer Applications 2019 Solved Question Paper

ICSE 10th Computer Applications 2019 Solved Paper

## SECTION A (40 Marks)

Answer all questions from this Section

Question 1:
(a) Name any two basics Principle of Object-Oriented Programming 
Ans. Encapsulation and Polymorphism

ICSE Class 10th Computer Applications ( Java ) 2019 Solved Question Paper

(b) Write a difference between Unary and Binary Operator 
Ans. Operators that acts on one operand are referred to as Unary Operators while Binary Operators acts upon two operand
Unary + or Unary – , increment/decrement are the example of Unary operator While binary operator +,-,*,/ and % are the example of binary operators , (+) adds values of its operands
(c) Name the keywords which: 
(i) indicates that a method has no return type
(ii) makes the variable as a class variable

Ans. (i)void
(ii) static (static variables are also known as Class variables.)

### ICSE Class 10th Computer Applications ( Java ) 2019 Solved Question Paper

(d) Write the memory capacity (storage size) of short and float data type in bytes 
Ans. short data type is of 2 bytes and float is of 4 bytes
(e) Identify and name the following tokens: 
(i) public
(ii) ‘a’
(iii) ==
(iv) { }
Ans. (i) public- Access Specifier
(ii) ‘a’- character
(iii) == is a Relational operator
(iv) { } is a Curly braces, Java uses them for surrounding the bodies of loops, methods and classes.
Question 2
(a) Differentiate between if else if and switch case statements 
Ans. Expression inside if or else if statement decide whether to execute the statements inside if block or under else if block. On the other hand, expression inside switch statement decide which case to execute.
You can have multiple if statement for multiple choice of statements. In switch you only have one expression for the multiple choices.
(b) 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);

Ans. 2019
(c) What are the various types of errors in Java 
Ans. (i) Syntax or Compile time error
(ii) Logical error
(iii) Exception or Runtime error
(d) State the data type and value of res after the following is executed 
char ch=’9′;
res = Character.isDigit(ch);

Ans. Data type is boolean and the value in res will be true

ICSE Class 10th Computer Applications ( Java ) 2019 Solved Question Paper

(e) What is the difference between linear search & binary search technique 
Ans. Input elements needs to be sorted in Binary Search and not in Linear Search
Linear search does the sequential access whereas Binary search access data randomly.
Question 3
(a) Write a Java expression for the following: 
|x²+2xy|

Ans. Math.abs(Math.pow(x, 2)+2*x*y));
(b) Write the return data type of the following functions: 
(i)startsWith()
(ii)random()

ICSE Class 10th Computer Applications ( Java ) 2019 Solved Question Paper

Ans.(i) boolean
(ii)double
(c)If the value of basic = 1500, what will be the value of tax after the following statement is executed 

`tax = basic > 1200 ? 200 : 100`

Ans. 200
(d) Give the output of the following code and mention how many times loop will execute ? 

```int i;
for(i=5;i>=1;i--)
{
if(i%2==1)
continue;
System.out.print(i+" ");
}```

Ans. Answer will be 4 2
Explanation: So i is initialized as 5 which is greater than 1 which means body of for loop will execute 5 times, since the keyword continue is used in body of if & expression 5 % 2 == 1 is true , then if will get executed for the very first time & since because of continue (the continue keyword causes control to immediately jump to the update statement.) the next statement just after the body of if will not be executed.
(e) State the difference between call by value and call by reference: 
Ans. Call by Value:(i) While calling a function, we pass values of variables to it.
(ii) In this, the value of each variable in calling function is copied into corresponding dummy variables of the called function
Call By Reference: While calling a function, instead of passing the values of variables, we pass address of variables(location of variables) to the function known as “Call By References.
(f) Give the Output of the following: 
Math.sqrt(Math.max(9,16))

Ans. 4.0
(g) Write the output of the following: 
String s1=”phoenix”;String s2=”island”;
System.out.println(s1.substring(0).concat(s2.substring(2)));
System.out.println(s2.toUpperCase());

Ans. s1.substring(0) is phoenix & s2.substring(2) is land , concat() function will concatenate “phoenix” & “land”
From s2.toUpperCase(), “island” will be converted into upper case
Output: phoenixland
ISLAND
(h) Evaluate the following expression if the value of x=2,y=3 and z=1.
v = x + – -z + y++ + y 

Ans. v = x+ – -z + y++ + y
v=2 + 0 + 3 + 4
v=9
(i) String x[]={“Artificial intelligence”,”IOT”,”Machine learning”,”Big data”}: 
Give the output of the following statements:
(i) System.out.println(x);
(ii)System.out.println(x.length);

Ans. (i) Big data
(ii) 4
(j) What is meant by a package.Give an example 
Ans. Package in Java is a mechanism to encapsulate a group of classes, sub packages and interfaces., examples : lang , io , util etc..

## 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
Design a class name ShowRoom with the following description:
Instance variables/data members:
String name: to store the name of the customer.
long mobno: to store customer’s mobile number.
double cost: to store the cost of the item purchased.
double dis: to store the discount amount.
double amount: to store the amount to be paid after discount.
Methods:
ShowRoom(): default constructor to initialize the data members
void input(): to input customer name, mobile number, cost
void calculate(): to calculate discount on the cost of purchased items, based on the following criteria

 Cost Discount(In percentage) Less than or equal to ₹ 10000 5 % More than ₹ 10000 and less than or equal to ₹ 20000 10 % More than ₹ 20000 and less than or equal to ₹ 35000 15 % More than ₹ 35000 20%

void display()- To display customer, mobile number, amount to be paid after discount.
Write a main() method to create an object of the class and call the above methods.
Ans.

```import java.util.Scanner;
class ShowRoom
{
String name;
long mobno;
double cost,dis,amount;
ShowRoom()		//default constructor
{
name="";
mobno=0L;
cost=0.0d;
dis=0.0d;
amount=0.0d;
}
void input()
{
Scanner kb = new Scanner(System.in);
name=kb.nextLine();
mobno=kb.nextLong();
System.out.print("Enter cost of item purchased: ");
cost=kb.nextDouble();
}
void calculate()
{
if(cost<=10000)
{
dis = cost * 5/100;
amount = cost - dis;
}
else if(cost>10000&&cost<=20000)
{
dis = cost * 10/100;
amount = cost - dis;
}
else if(cost>20000&&cost<=35000)
{
dis = cost * 15/100;
amount = cost - dis;
}
else if(cost>35000)
{
dis = cost * 20/100;
amount = cost - dis;
}
}
void display()
{
System.out.println("Name of the customer: "+name);
System.out.println("Mobile number : "+mobno);
System.out.println("Amount to be paid after discount: "+amount);
}
}
class UseShowRoom
{
public static void main(String[]args)
{
ShowRoom s = new ShowRoom();
s.input();
s.calculate();
s.display();
}
}```

Sample output:

```Enter your name: Technocrats Informatics
Enter cost of item purchased: 25549
Name of the customer: Technocrats Informatics
Mobile number : 9044414979
Amount to be paid after discount: 21716.65```

### ICSE Class 10th Computer Applications 10 Year Solved Question Papers

Question 5
Use the switch case statement, write a menu driven program to do the following:
(a) To generate and print letters from A to Z & their Unicode (b) Display the following pattern iteration (looping) statement:

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5

Ans.

```import java.util.Scanner;
{
public static void main(String[]args)
{
Scanner kb=new Scanner(System.in);
System.out.println("Press 1 to See Unicode of A to Z ");
System.out.println("Press 2 for pattern");
System.out.print("Enter Your Choice (1 or 2):");
int choice = kb.nextInt();
switch(choice)
{
case 1:
System.out.println("Letters : Unicode");
for(int i=65;i<=90;i++)
{
System.out.println((char)i+" : "+i);
}
break;
case 2:
int k;
for(int i=1;i<=5;i++)
{
k=1;
for(int j=1;j<=5;j++)
{
if(j<=i)
{
System.out.print(k);
k++;
}
else
System.out.print(" ");
}
System.out.println();
}
break;
default:
System.out.println("Invalid choice");
}
}
}```

Sample output 1:

```Press 1 to See Unicode of A to Z
Press 2 for pattern
Enter Your Choice (1 or 2): 1
Letters : Unicode
A : 65
B : 66
C : 67
D : 68
E : 69
F : 70
G : 71
H : 72
I : 73
J : 74
K : 75
L : 76
M : 77
N : 78
O : 79
P : 80
Q : 81
R : 82
S : 83
T : 84
U : 85
V : 86
W : 87
X : 88
Y : 89
Z : 90
```

Sample output 2:

```Press 1 to See Unicode of A to Z
Press 2 for pattern
Enter Your Choice (1 or 2): 2
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5```

Question 6
Write a program to input 15 integer elements in an array and sort them in ascending order using the bubble sort technique.
Ans.

```import java.util.Scanner;
class BubbleSort{
public static void main(String[]args){
Scanner kb = new Scanner(System.in);
int arr []=new int;
System.out.println("Enter 15 elements in an array ");
for(int i=0;i<15;i++)
{
arr[i]=kb.nextInt();
}
int temp;
int x=arr.length;
for(int i=0;i<x-1;i++)
{
for(int j=0;j<x-1;j++)
{
if(arr[j]>arr[j+1])
{
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
for(int i=0;i<x;i++)
{
System.out.print(arr[i]+" ");
}
}
}```

Sample output

```Enter 15 elements in an array
2
9
4
13
8
14
6
15
7
19
5
1
3
16
18
1 2 3 4 5 6 7 8 9 13 14 15 16 18 19
```

Question 7 Design a class to overload a function series() as follows:
(i) void series(int x, int n) – To display the sum of the series given below:
x¹+x²+x³+. . . . .x^n terms</b
(ii)void series(int p) – To display the following series
0, 7, 26, 63. . . . .p terms

(iii) void series() – To display the sum of the series given below:
1/2+1/3+1/4+. . . . . .1/10

Ans.

```class Overload
{
void series(int x,int n)
{
int sum1=0;
for(i=1;i<=n;i++)
{
sum1= sum1 + Math.pow(x,i);
}
System.out.println(sum1);
}
void series(int p)
{
int sum2=0;
for(int i=1;i<=p;i++)
{
sum2 = sum2 + i*i*i-1;
}
System.out.println(sum2);
}
void series()
{
int sum3=0;
for(int i=2;i<=10;i++)
{
sum2 = sum2 + 1/i;
System.out.println(sum3);
}
}
}```

Question 8 Write program to input a sentence and convert it into uppercase and count and display the total no. of words starting with a letter ‘A’.
Example:
Sample Input: ADVANCEMENT AND APPLICATION OF INFORMATION TECHNOLOGY ARE EVER CHANGING
Sample Output: Total number of word Starting with letter ‘A’= 4

Ans.

```import java.util.Scanner;
class CountLetterA
{
public static void main(String[]args)
{
Scanner kb = new Scanner(System.in);
System.out.print("Enter a sentence: ");
String str=kb.nextLine();
str=str.toUpperCase();
int count=0;
for(int i=0;i<str.length();i++)
{
if(i==0&&str.charAt(i)=='A')
count++;
if(i>0)
if((str.charAt(i - 1) == ' ')&&(str.charAt(i)=='A'))
count++;
}
System.out.println("Total number of words Starting with letter 'A'= "+count);
}
}```

or

```import java.util.Scanner;
class CountLetterA
{
public static void main(String[]args)
{
Scanner kb = new Scanner(System.in);
System.out.print("Enter a sentence: ");
String str=kb.nextLine();
str=" "+str.toUpperCase();
int count=0;
for(int i=0;i<str.length();i++)
{
if(str.charAt(i)==' '&&str.charAt(i+1)=='A')
count++;
}
System.out.println("Total number of words Starting with letter 'A'= "+count);
}
}```

Sample output 1

```Enter a sentence: advancement and application of information technology are ever changing
Total number of word Starting with letter 'A'= 4```

Question 9
A tech number has a even number of digits if the number is split in two equal halves , then the square of sum of these two halves is equal to the number itself. Write a program to generate and print all 4 digit tech numbers:
Example:
Consider the number 3025
Square of sum of the halves of 3025

= (30 + 25)²
= (55)²
3025 is a tech number

Ans.

```class TechNum
{
public static void main(String[]args)
{
int fh,sh,sum_sqr;
for(int i=1000;i<=9999;i++) //Taking 4 digit numbers only
{
fh=i/100;
sh=i%100;
sum_sqr=(int)Math.pow((fh+sh),2);
if(sum_sqr==i)
System.out.print(i+" ");
}
}
}```

Sample output 1

```Enter a number: 3025
Its a tech number```

Sample output 2

```Enter a number: 4554
Not a tech number.```

Checkout 10 years Solved Question Papers ICSE 10 Years Solved Papers

## Arrays Level 1

Congratulations - you have completed Arrays Level 1.

You scored %%SCORE%% out of %%TOTAL%%.

Your performance has been rated as %%RATING%%

 1 2 End

1. ###### Shantanu

2. ###### Shantanu

Hey can u send 10 years solved papers as pdf??

1. ###### Shubham Tripathi

Hey Shantanu you can get pdf’s & eBooks from the product section , visit Product for more

1. ###### Shantanu

okay thanks !!

1. ###### Shubham Tripathi

you’re welcome

2. ###### Charmelli Dar

Good

2. ###### Rohit sinha

in question 9 can we use If instead of for

1. Hey Rohit , because in question there specifically mentioned that “print all 4 digit tech numbers” so we must have to use for loop

1. ###### akash

Yes u’re right 🙂

2. ###### Akash

Since u’ve to print all the tech no. in between 1000 & 9999 , so we compulsorily need to use for loop or any other loop

3. ###### Kinjal Agravat

I have to get solved question paper PDF for 10th ICSE

1. Hey Kinjal, you can get pdf’s & eBooks from the product section , visit Product for more

4. ###### Koushikv

(h) Evaluate the following expression if the value of x=2,y=3 and z=1.
v=x+ –z+y++ +y
Ans. v=x+ –z+y++ +y
v=2 + 0 + 3 + 4
v=9
In this you have writen -z =0 but in question the value of z=1

1. Hey Koushikv , yes the value of z is 1 but , if you see expression , z is with pre-decrement operator … so that is the reason it will become 0

5. ###### Janny

In question 6 when we are actually running the the programme it shows as no output. Why is it happening?

1. Hey Janny , this program is absolutely running fine on every machine (both linux & windows), will you please share the screenshot of you program along with output screen , please write us at [email protected]

1. ###### Janny

Hello
Dear sir,
I had actually written the whole program an tried to execute it.but I don’t know why didn’t it work earlier but later on when I tried it work.
thanks a lot for putting efforts to clarify my doubt and I have a complaint regarding that we cannot delete a complaint if it is has been put up by mistake.
Regards,
Janny.

1. Hey Janny,
Thank you for your feedback/suggestion on Delete option for any Comment/Complaint/Query , i can understand that there should be a option for a User to Delete there Query if the problem has been resolved but our team has analysed that OLD query can be a solution for new users ,So that is the reason few months ago we had removed this option.
Best Regards
Author ,
2. 6.  