10 ICSE - Midterm
10 ICSE - Midterm
R. T. Nagar, Bangalore
Mid Term Examination – October 2023
Sub: Computer Application
Class: X [ICSE]
Date: 13/10/23
Time Duration: 2 hours[9.30a.m to 11.30a.m.] Max Marks: 100
Answers to this paper must be written on the separate paper.
You will not be allowed to write during the first 15 minutes.
The time is to be spent in reading the question paper.
This paper is divided into two sections.
Attempt all questions from Section A and any four questions from Section B.
Question 2
1. Write Java statements for the following [2]
a. To display the String s after removing the last word.
b. To display the first letter of the String s in capitals and rest of the letters in small letters
7. Correct the errors if any in the following code. Also mention the type of error [2]
String s=”12345”;
for(int i=0;i<=5;i++)
System.out.println(s.charAt(i));
8. Name the built-in method and the class name to which it belongs, that is used to perform the following
a. To convert the String consisting of digits to double datatype.
b. To join 2 strings.
Question 3 [15]
Define a class CourierService with the following descriptions:
class: CourierService
Instance Variables/ Data Members:
String name – To store the name of the customer
String type – To store the type of parcel (Ordinary/Express)
int weight – to store the weight of the parcel
double charge – to store the calculated charges
Member methods:
CourierService() – default constructor to initialize all the instance variables.
void accept() – To accept the name of the customer, type and weight of the parcel
void calculate() – To calculate the charges as per the following tariff:
Weight in Kgs Charge Charge
Ordinary Express
Upto 10 Rs. 800 Rs. 1500
11 – 20 Rs. 1500 Rs. 3000
Above 20 Rs. 4000 Rs. 5500
Question 4 [15]
Write a menu driven program to perform as given below:
√3 2
1. To find the area of equilateral triangle = (s ) where s= side of an equilateral triangle.
4
1
2. To find the area of isosceles triangle = 4 𝑏 ∗ √4𝑎2 − 𝑏 2
3. To find the area of scalene triangle = √s(s − a)(s − b)(s − c), where s= (a+b+c)/2
Question 5 [15]
A Krishnamurthy number is a number whose sum of factorial of digits is equal to the number.
Ex: 145 → 1!+4!+5! → 1+24+120 → 145
Write a program to input a number check and display whether it is a Krishnamurthy number or not.
Question 6 [15]
Create a class to overload the function palindrome( ) as follows:
1. boolean palindrome(int n) - checks and returns true if the number is palindrome else returns false
2. boolean palindrome(String s) – checks and returns true if the string is palindrome else returns false
Question 7 [15]
Write a program to input a String check and display whether it is a Unique word or not. A word is said to be
unique if the letters are not repeated in the string, i.e., all the letters are different
Ex: COMPUTER
Output: Unique Word
Question 8 [15]
Create a class to overload the function display as given below:
void display(int n) – displays all the even digits of the number
void display(int x, int n) – displays the series x, x4, x7, … n terms
void display(String s) – displays the pattern as given below
Ex: if s=”RACE”
Output: R
RA
RAC
RACE