0% found this document useful (0 votes)
5 views5 pages

Practical10 - 2025 - 2

Uploaded by

mejagan321
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)
5 views5 pages

Practical10 - 2025 - 2

Uploaded by

mejagan321
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/ 5

Class X Computer Applications

Practical questions 2025-26


1. Define a class Telephone having the following description:

Class Name : Telephone


Data Members
int prv ,pre : to store the previous and present meter
readings. int call : to store the calls made (ie, pre – prv)
String name : to store name of the
customer double amt: to store the amount
double total : to store the total amount to be
paid. Member Functions:
void input() : Stores the previous reading, present reading and name
of the consumer
void cal() : calculates the amount and total amount to be paid.
void display() : Display the name of the consumer, calls made, amount and
total amount to be paid.
Write a program to compute the monthly bill to be paid according to the given
conditions and display the output as per the given format.
Calls made Rate
Up to 100 calls No charge
For the next 100 calls 90 paise per calls
For the next 200 calls 80 paise per calls
More than 400 calls 70 paise per calls
However, every consumer has to pay Rs. 180 per month as monthly rent for availing the
service.
Output:
Name of the consumer Calls made Amount to be paid

2. Define a class to overload the function print as

follows: void print() - to print the following format

1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
void print(int n) - To check whether the number is a Palindrome number.or not . A number
is said to be palindrome, if the number reversed , it will give the original number.
Eg: SI : 101

SO :It is a palindrome number.

3. Design a class to overload a method volume( ) as follows:

i) double volume ( double R) – with radius R as an argument , returns the volume of sphere
using the formula.

V = 4/3πR3

ii) double volume ( double H, double R) - with height H and radius R as arguments, returns
the volume of a cylinder.

V= πR2H

iii) double volume(double L, double B, double H) – with length L , breadth B and height H as
arguments , returns the volume of a cuboid.

V = LBH.

Write main method to invoke all the above mentioned functions.

4. Write a menu driven program to perform the following:

i) To check whether a number is prime number or not.

ii) To check whether a number is lead number or not.(A number is said to be lead , if the sum
of even digits and odd digits are same.)
Eg: 3669, 3+9=12. 6+6 =12. Hence it is a lead number.
5. Write a menu driven program to perform the following:

i) To find the sum of the series.

S = (1*2) + (2*3) + (3*4) +(4*5)+…............................. +(19*20)


ii) S = a – a3 + a5 -a7 +…………………….

6. Write a menu driven program to perform the following:

i) 0,3,8,15,

ii) 1,11,111,1111,11111

7. Write a program to accept a string and display the new string by changing the uppercase
letters in to lowercase and viceversa.
SI: WeLComE_2025#!
SO:wElcOMe_2025#!
8.Write a program to accept a string and perform the following:
1.Number of uppercase letters
2.Number of lowercase letters
3.Number of digits
4.Number of letters
5.Number of special characters.

9. Write a program to accept a string and display the string by removing the vowels.
SI : computer
SO: cmptr
10.Write a program to accept a string and convert to uppercase letters and count the number of
consecutive letters in the string.
SI: SHE WAS THE FEEDING THE LITTLE RABBIT WITH AN APPLE.
SO: No. of consecutive letters = 4
11.Write a program to accept a string and check whether it is super string or not.
[Super string means number of uppercase letters and lowercase letters are equal]
SI: CoMpuTEr
SO: It is a super string.
12. Write a program to accept a string and convert to lowercase letters. Find the largest letter
and smallest letter from the string.
SI: computer
SO: The largest letter = u
The smallest letter = c
13. Write a program to accept 10 different numbers in a Single Dimensional Array(SDA).
Display the greatest and smallest numbers of the array elements.
Sample Input:
43
45
92
87
64
76
81
65
12
31
Sample Output:
Greatest Element : 92
Smallest Element : 12
14. Write a program to accept 10 different numbers in an SDA. Now, enter a number and search
whether the number is present or not in the list of array elements by using Linear Search
technique.
Sample Input:
74
56
62
77
46
67
59
80
42
26
Sample Output:
Enter a number to be searched : 42
The Item found in 9 position.
15. Write a program to accept n names in an array and display all the names starting with ‘A’
and ending with ‘A’.
SI : Enter the size of the array
5
Enter the array elements
Anamika
Anu
Aisha
Bindu
Neena
Sample Output:
Anamika
Aisha
16. Write a program to accept 10 names in an array and perform Binary Search technique.
17.Write a program to accept 10 numbers in an array and perform sorting in ascending order
using Selection Sort technique.
18.Write a program to accept 10 numbers in an array and perform sorting in descending order
using Bubble Sort technique.
19.Write a program in java to store the numbers in 4*4 matrix in a Double Dimensional
Array.Find the sum of the numbers of the left diagonal and the sum of the numbers of the right
diagonal of the matrix by using an input statement.
Sample Input:
12 21 13 14
24 41 51 33
61 11 30 39
59 82 41 76
The sum of the left diagonal elements = 159
The sum of the right diagonal elements = 135
20.Write a program in java to store the numbers in two different Double Dimensional Arrays
m[4][4] and n[4][4]. Find the sum of the numbers of the corresponding elements of the two
arrays m and n and store them in the array p[4][4] by using an input statement. Display the
elements of array p in a matrix form:
Array m Array n Array P
12 23 33 22 8 22 31 15 20 45 64 37
20 31 44 10 11 16 30 26 31 47 74 36
10 25 14 8 10 17 25 33 20 42 39 41
41 52 24 12 12 24 21 32 53 76 45 44
**********************************************

You might also like