0% found this document useful (0 votes)
142 views6 pages

RANI Icse Practicals

1. The document provides programming questions and problems for an ICSE practical exam to be held on January 26, 2014. 2. It includes 25 questions ranging from basic programs like printing names in alphabetical order to more complex programs involving classes, functions, and algorithms. 3. The questions cover a variety of programming concepts like strings, arrays, functions, classes, recursion, searching, and pattern printing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
142 views6 pages

RANI Icse Practicals

1. The document provides programming questions and problems for an ICSE practical exam to be held on January 26, 2014. 2. It includes 25 questions ranging from basic programs like printing names in alphabetical order to more complex programs involving classes, functions, and algorithms. 3. The questions cover a variety of programming concepts like strings, arrays, functions, classes, recursion, searching, and pattern printing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

ICSE Practical Programs- 2013-14

Note: The Date for the practical will be announced on the notice board by
January 26, 2014.

Questions for the practical will be given from the given question set ONLY
1 Write a program to accept 25 names from the user and print them in alphabetical
order. For example:
Input : Danish, Salman, Amir, Hritik, Madhuri
Output: Amir Danish Hritik Madhuri Salman

2 Write a program to accept roll number and marks in English from 10 students from the
user and print them in descending order of marks.

3 Write a program to accept a string from the user and print the following
(a) Number of characters
(b) Number of words in the string
(c) Count the number of words begin with capital letter
(d) Count how many times an input word is repeated in the string

4 Write a program to accept a string and check if it is a palindrome or not.

Example : input nitin


Output : palindrome
Input : peter
Output : not a palindrome

5 Write a program to accept a telephone number, name of the customer and number of
calls from the user and print the telephone bill based on the following conditions.

Number of calls rate per call(Rs)


Upto 100 nil
Next 100 0.80
Next 100 1.25
Next 100 1.65
Next 100 2.00
Above 500 2.50
The program should work for 15 users and should charge 12% service tax over the
actual bill amount.

6 The bill calculation in the above program should be done in a function called calculation
and return the value to the main program. The main program should print the final bill.

7 Write a program to accept 25 numbers from the user in a single subscripted


variable and print the following.
a) sum of odd numbers
b) product of even numbers
c) sum of all the numbers.

8 Write a program to input a number from the user and using a function called
Palindrome(), check and print whether the number is a palindrome number or not.(A
number is read same from both the sides is called palindrome number. E.g. 121, 454,
12321, 565…etc.)

9 Write a program to input a number from the user and using a returned type function
called Perfect( ), check and print whether the number is a perfect number or not. The
function returns true if the number is perfect otherwise false. (perfect number is a number
whose sum of the factors(except the original number) of the number is equal to the same
number. E.g.: 6: factors of 6: 1,2,3: sum = 1+2+3 = 6)

10 Define a java class with the following members.


Data members: code, name, basic, hra, da, PF.
Default constructor: Initializes, basic, hra, da and PF to zero.
Parameterized constructor: initializes basic, computes hra, da, PF as per the following criteria.
Hra = 10% of basic
Da – 55% of basic
PF = Rs. 1000.
Main method: computes and displays the net salary.
NetSalary = basic + da +hra – PF.

11 Using switch case write a program to accept a number from the used and print in the
output in the following format.
Example:
Input: 742
Output: seven four two

12 Using loop print the following pattern


(a)
1
12
123
1234
12345
……
…….
…….N
(b)
1
23
456
7 8 9 10
11 12…N

13 Write a program to print 25 terms of fibonacci series.


Example: 0 1 1 2 3 5 ……….upto 1000

14 Code number and cost and name of 10 products are given as follows
Code:101,102,103,104,105,106,107,108, 109, 110
Cost:25.50,45.00,300.50,75.25,90.00,99.99,65.50,70.00,99.99,100.00
Name of product: pepsi, coke, water, …….10 names

Write a Program to input code number of a product and print corresponding cost using binary
search.

15 A game of throwing dice is played between two players in which, each player throws a
dice unless his score adds up to 20. A player is declared “winner” with the minimum number
of throws. Write a program to perform the given task.

16 Write a program to input a string from the user and print it as given in the example:

Input: Mohandas Karamchand Gandhi


Output 1: M.K.G.
Output 2: M.K. Gandhi
Output 3: Gandhi. M.K

18 Write a program to Input a string from the user in the mixed case letters and print it in
title case letters.
e.g.: Input: hello hOW aRe yOu?
Output: Hello How Are You?

19 Write a program to input a string from the user and print frequency of alphabets, digits
and special characters in the string

20 Write a program to input name of country from the user and print the capital of that
country on the screen from the given set of data. If the input name of country is not present in
the list then print appropriate message.

Country Capital

India New Delhi


Pakistan Islamabad
England London
……. ……..
…….. ……..
…….. ……..
10 names

21 Write a program to input weight of a parcel and print cost of parcel based on the

following conditions

For first 1Kg Rs. 15.

Plus Rs. 8 for every 500 grams thereof.

22 Gravity of an object is calculated by the following set of equations

G = 32.17 (4390 / (4390 +H))2 , H >3

G = 32.17( 1 / (H + 4390))2 , H <=3

Where H is the height , to be taken from –4 to 10 and G is the gravity. Using an


overloaded function gravity( ), WAP to print all the values of G corresponding to the
values of H.

23 Create a class called BEST with the following data members and its member functions.
Data Members: Name of the customer, telephone number, number of calls, tax and the bill

Member functions:

Accept( ) : The function is used to input Name of the customer, telephone number and
number of calls from the user.

Billing ( ): The function calculates the bill amount based on the following conditions.

Number of calls Rate per call(Rs)


Up to 100 nil
Next 200 0.80
Next 200 1.25
Above 500 2.50
The program should add 12% service tax over the bill amount to get the final bill amount.
Display ( ): The function should print Name of the customer, Telephone number, Number of
calls, and the bill amount on the screen.

Constructor: create a constructor to declare all the data members to nil/zero.

Main( ): Create an object of the class and execute all the functions in logical sequence for
250 customers .

24 2

34

456

5678

6 7 8 9 10

25 Encryptology is the process of encoding a string to another form in such a way that it should
not be known to unauthorized person. You are to encode a program in java by using a class
to encrypt a string in such a way that each character of the given string is replaced with a
character at mentioned gap (say, move). If move is positive then the characters are replaced
by other characters ahead by given move. For a negative move, the characters are replaced
by other characters backward. In case move is 0 then the same string is produced.
You must keep in your mind that the characters are wrapped around while encryption i.e. Z
is followed by A and A is followed by Z considering the moves to be negative and positive
respectively.
e.g., ABZ can be encrypted as CDB if move = 2
ABZ can be encrypted as YZX if move = -2
ABZ can be encrypted as ABZ if move = 0
Class : Encode
Data members/Instant variables :
String s, str
Member methods :
void input( ) : To assign string st to s. Initialize String str = “”;
void perform (int move): To perform encryption at defined move.
void display( )To display the encrypted string.

*****************

You might also like