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

Holiday Homework Computer Science X

The document outlines a computer project for ICSE Class X students at Ann Mary School, consisting of 29 programming tasks. Each task requires students to write code that solves specific problems, such as calculating fares, determining special numbers, and generating patterns. Students are instructed to include variable description tables and comments in their programs, and they must attempt any 25 questions from the list.

Uploaded by

sarthaksahni60
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views6 pages

Holiday Homework Computer Science X

The document outlines a computer project for ICSE Class X students at Ann Mary School, consisting of 29 programming tasks. Each task requires students to write code that solves specific problems, such as calculating fares, determining special numbers, and generating patterns. Students are instructed to include variable description tables and comments in their programs, and they must attempt any 25 questions from the list.

Uploaded by

sarthaksahni60
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ANN MARY SCHOOL

COMPUTER PROJECT – ICSE (CLASS X)

Instructions-
 Attempt any 25 questions
 Write variable description table and few comments in each program.

S NO. PROGRAMS
1 A special two-digit number is such that when the sum of its digits is added to the product
of its digits, the result is equal to the original two-digit number.
Example: Consider the number 59.
Sum of digits = 5 + 9 = 14
Product of digits = 5 * 9 = 45
Total of the sum of digits and product of digits = 14 + 45 = 59
Write a program to accept a two-digit number. Add the sum of its digits to the product of
its digits. If the value is equal to the number input, display the message "Special 2 - digit
number" otherwise, display the message "Not a special two-digit number".

2 An air-conditioned bus charges fare from the passengers based on the distance travelled
as per the tariff given below:
Distance Travelled Fare
Up to 10 km Fixed charge ₹80
11 km to 20 km ₹6/km
21 km to 30 km ₹5/km
31 km and above ₹4/km
Design a program to input distance travelled by the passenger. Calculate and display the
fare to be paid.

3 A bank announces new rates for Term Deposit Schemes for their customers and Senior
Citizens as given below:
Term Rate of Interest (General) Rate of Interest
(Senior Citizen)
Up to 1 year 7.5% 8.0%
Up to 2 years 8.5% 9.0%
Up to 3 years 9.5% 10.0%
More than 3 years 10.0% 11.0%
The 'senior citizen' rates are applicable to the customers whose age is 60 years or more.
Write a program to accept the sum (p) in term deposit scheme, age of the customer and
the term. The program displays the information in the following format:

Amount Deposited Term Age Interest earned Amount


Paid
xxx xxx xxx xxx xxx
1
4
A courier company charges differently for 'Ordinary' booking and 'Express' booking based
on the weight of the parcel as per the tariff given below:
Weight of parcel Ordinary booking Express booking
Up to 100 gm ₹80 ₹100
101 to 500 gm ₹150 ₹200
501 gm to 1000 gm ₹210 ₹250
More than 1000 gm ₹250 ₹300
Write a program to input weight of a parcel and type of booking (`O' for ordinary and 'E'
for express). Calculate and print the charges accordingly.
5 Write a menu driven program to calculate:
1. Area of a circle = p*r2, where p = (22/7)
2. Area of a square = side*side
3. Area of a rectangle = length*breadth
Enter 'c' to calculate area of circle, 's' to calculate area of square and 'r' to calculate area
of rectangle.

6 Write a program using switch case to find the volume of a cube, a sphere and a cuboid.
For an incorrect choice, an appropriate error message should be displayed.
1. Volume of a cube = s * s *s
2. Volume of a sphere = (4/3) * π * r * r * r (π = (22/7))
3. Volume of a cuboid = l*b*h

7 Write the program in Java to display the first ten terms of the following series:
0, 1, 2, 3, 6…..

8 Write the program in Java to display the first ten terms of the following series:
1, 11, 111, 1111,
9 Write the program in Java to display the first ten terms of the following series:
1, -3, 5, -7, 9,
10 Write the program in Java to find the sum of the following series:
S = 1 + 1 + 2 + 3 + 5 +..........to n terms
11 Write the program in Java to find the sum of the following series:
S = 2 - 4 + 6 - 8 +..........to n
12 Write the program in Java to find the sum of the following series:
S = (a+1) + (a+2) + (a+3) +.......... + (a+n)
13 Write the program in Java to find the sum of the following series:
S = (1/a) + (2/a2) + (3/a3) +.......... to n

2
14 Write the program in Java to find the sum of the following series:
S = a - a3 + a5 - a7 +.......... to n
15 Write the program in Java to find the sum of the following series:
S = (a/2) + (a/5) + (a/8) + (a/11) +..........+ (a/20)
16 Write a program to input a number. Display the product of the successors of even digits of
the number entered by user.
Input: 2745
Output: 15
[Hint: The even digits are: 2 and 4
The product of successor of even digits is: 3*5= 15]
17 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
18 A prime number is said to be 'Twisted Prime', if the new number obtained after reversing
the digits is also a prime number. Write a program to accept a number and check whether
the number is 'Twisted Prime' or not.
Sample Input: 167
Sample Output: 761
167 is a 'Twisted Prime'.

Write a program to input a number and check whether it is a prime number or not. If it is
not a prime number then display the next number that is prime.
Sample Input: 14
Sample Output: 17
19 Write a program to input a number. Check and display whether it is a Niven number or
not. (A number is said to be Niven which is divisible by the sum of its digits).
Example: Sample Input 126
Sum of its digits = 1 + 2 + 6 = 9 and 126 is divisible by 9.

20 Write a program to accept a number and check whether it is a 'Spy Number' or not. (A
number is spy if the sum of its digits equals the product of its digits.)
Example: Sample Input: 1124
Sum of the digits = 1 + 1 + 2 + 4 = 8
Product of the digits = 1*1*2*4 = 8

3
21 Using a switch statement, write a menu driven program to:
(a) Generate and display the first 10 terms of the Fibonacci series
0, 1, 1, 2, 3, 5
The first two Fibonacci numbers are 0 and 1, and each subsequent number is the sum of
the previous two.
(b) Find the sum of the digits of an integer that is input by the user.
Sample Input: 15390
Sample Output: Sum of the digits = 18
For an incorrect choice, an appropriate error message should be displayed.

22 Write program to find the sum of the following series:


S = 1 + (3/2!) + (5/3!) + (7/4!) +......... to n
[HINT- use nested loops]
23 Write program to find the sum of the following series:
S = a - (a/2!) + (a/3!) - (a/4!) +.......... to n
24 Write program to find the sum of the following series:
S = (2/a) + (3/a2) + (5/a3) + (7/a4) +.......... to n
25 Write a program to input two numbers and check whether they are twin prime numbers or
not.
Hint: Twin prime numbers are the prime numbers whose difference is 2.
For example: (5,7), (11,13),..........and so on.
26 Write the programs to display the following patterns:
(a)
1
31
531
7531
97531

(b)
1 2 3 4 5
6 7 8 9
10 11 12
13 14
15

4
27 Write the programs to display the following patterns:

(a)
1
10
101
1010
10101

(b)
*
*#
*#*
*#*#
*#*#*
28 Write a program to generate a triangle or an inverted triangle till n terms based upon the
user's choice.

Example 1:
Input: Type 1 for a triangle and
Type 2 for an inverted triangle
Enter your choice 1
Enter the number of terms 5
Sample Output:

1
22
333
4444
55555

Example 2:
Input: Type 1 for a triangle and
Type 2 for an inverted triangle
Enter your choice 2
Enter the number of terms 6
Sample Output:
666666
55555
4444
333

5
22
1

29 Write a program to display the following patterns:

(a)
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

Write a program to display the following patterns:


(b)
11111
22222
33333
44444

You might also like