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

Class X Computer Applications Project

The document outlines a project for Class X Computer Applications, detailing various programming tasks to be completed in an Oxford file by June 16, 2022. It includes tasks related to amicable numbers, happy numbers, perfect numbers, Keith numbers, Pascal's Triangle, and various class definitions for different mathematical and data handling operations. Each task requires writing specific programs with comments, outputs, and structured methods.

Uploaded by

Rituraj Pradhan
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)
9 views5 pages

Class X Computer Applications Project

The document outlines a project for Class X Computer Applications, detailing various programming tasks to be completed in an Oxford file by June 16, 2022. It includes tasks related to amicable numbers, happy numbers, perfect numbers, Keith numbers, Pascal's Triangle, and various class definitions for different mathematical and data handling operations. Each task requires writing specific programs with comments, outputs, and structured methods.

Uploaded by

Rituraj Pradhan
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

ICSE PROJECT CLASS – X

SUB: COMPUTER APPLICATIONS


(Procedure/Note: To Be Done in an Oxford File. DATE of SUBMISSION 16.06.2022)
 Make Cover Page  Write the program along with its comments,
 Make Index of programs with page no. variable description & output
 Write Introduction  Write Conclusion & Acknowledgement

1. Amicable numbers are two different numbers so related that the sum of the proper divisors of each is
equal to the other number.
For example, the smallest pair of amicable numbers is (220, 284); for the proper divisors of 220 are 1, 2, 4,
5, 10, 11, 20, 22, 44, 55 and 110, of which the sum is 284; and the proper divisors of 284 are 1, 2, 4, 71 and
142, of which the sum is 220.
A Happy number is defined by the following process: Starting with any positive integer, replace the
number by the sum of the squares of its digits, and repeat the process until the number equals 1.
For example, 19 is happy, as the associated sequence is:
12 + 92 = 82
2 2
8 + 2 = 68
62 + 82 = 100
2 2 2
1 + 0 + 0 =1
Write a menu driven program using switch-case to send either character ‘A’ or ‘H’ as parameter and
input the numbers to check if it an Amicable Number or Happy number or none of these.

2. n is a perfect number if the sum of the factors of the number including 1 and excluding itself is n.
For example,
6 =1+2+3 and
28=1+2+4+7+14
Define a class called numberProblems which has the following functions:
int nthPrime(int n) - method that returns the nth prime number given as parameter.
void perfectNosBelow(int lim) - which first prints out the nth prime number given as limit and then
prints all perfect numbers less than lim. Each perfect number should
be printed on a separate line along with its factors. For example, the
output from perfectNosBelow(500) will be:
500th prime number=3571
6 =(1,2,3)
28 =(1,2,4,7,14)
496=( (1, 2, 4, 8, 16, 31, 62, 124, 248)

3. 197 is a Keith Number because it follows a specific pattern demonstrated hereunder: -


197
Step 1
1+9+7
=17
Step 2
9+7+17
=33
Step 3
7+17+33
=57
Step 4
17+33+57
=107
Step 5
33+57+107
=197
Write a program to print all three digit Keith Numbers.
4. Write a program to create a class named Auxilium with the following properties: -
Instance variables/data members:
int n - to store the number using scanner class
int c - to count the factors of a number
boolean a - to store true if number is prime
int sum - to find the sum of the prime numbers
Member methods:
Auxilium() - default constructor to initialize data members
void input() - method to input a number using scanner class
boolean prime() - method that checks if the original number as well as others are prime
numbers or not. For e.g. Original number = 41 is a prime number
void check() - method to print the output – “Auxilium Number” if the
combination of all the consecutive prime numbers up to the original
number when added gives rise to the same number. For e.g.
Original number = 41
Combination = 2 + 3 + 5 + 7 + 11 + 13
= 41
Result = Auxilium Number
For any other prime number not producing desired result, the program prints the message–
“Not an Auxilium Number” and if the user inputs any composite number then the program prints –
“Sorry! Not Possible!”.
Write a main method to create the object of the class and call the above methods.

5. In a Pascal’s Triangle the extreme left and right slot is guarded by 1 and the numbers in between are
formed by adding the previous two numbers. For e.g.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Write a program to print the Pascal’s Triangle in such a way that if the user gives the input 5 then the
computer print just the five rows of Pascal’s Triangle.

6. Design a class ShowTime to overload a function named display() to produce the following output:
(i) void display (int x, int n) with two integer arguments and print the sum of the series,

sum =
(ii) void display (String word) with one String argument & print the following using String function:
 Length of the word
 The last letter/character of the word
 New word leaving the starting alphabet
For e.g. Output:
Input: Length of the word =4
Pray The last letter of the word =y
New string leaving the starting alphabet = ray
[Note: In the second part, use appropriate String functions along with [Link]() statement to
print the output]

7. Write a program to print the sum of the terms in the series mentioned below: -
s=x 2 +

Note: The value of n must be an even number. In case if it’s an odd number then print the message –
“Not possible”.
8. Define a class result described as below: -
Data members of class variables:
name - to store the name
s1, s2 and s3 - Mark in 3 subjects in decimal
max - in decimal to store the maximum marks
Method of class: -
(i) result() - A constructor to initialize the data members
(ii) void accept() - Using suitable scanner class function input name of Student (name) & marks
in 3 subjects
(iii) void compute() - to find and store maximum marks in 3 subjects & store in max
(iv) void display() - to print name, marks in 3 subjects and maximum marks.
Write a main method to create an object of the class and call the above member method to print the
output.

9. Write a program to declare a single dimension array with 6 compartments and store 6 three-digit
numbers only in it using scanner class.
Now, recreate the array in such a way that numbers present in the odd compartments are sorted in
descending order whereas numbers in the even compartments are formed by adding the sum of the
squares of the extreme digits with the cube of the middle digit. For e.g. ,
Original array: -
847 739 848 492 975 348
Working:
82+43+72 973 82+43+82 942 92+73+52 843
Output:
177 973 192 942 449 843

10. Write a program to input 4 names of four characters length in a single dimension array using scanner
class. Add and print the ASCII value of each letter in individual names as demonstrated in the example.
Finally compare the values and print the name with highest ASCII total. For e.g.
JACK = 74 + 65 + 67 + 75 = 281
SONY = 83 + 79 + 78 + 89 = 329 Winner is Sony with 329 points
JOHN = 74 + 79 + 72 + 78 = 303
TINA = 84 + 73 + 78 + 65 = 300
While doing the program care must be taken that: -
(i) The names should be of 4 letters only
(ii) Calculation should be done on the basis of all the Uppercase or Lowercase letters.

11. Write a program to enter the names of 5 countries in an Array and their capitals in another Array. Sort
the names of the countries alphabetically in such a way that their capitals are also sorted and then merge
them together in a SDA with 10 compartments where each country is followed by its capital.
For e.g.
Input:
PERU INDIA RUSSIA BHUTAN SPAIN
LIMA DELHI MOSCOW THIMPU MADRID
Output:
BHUTAN THIMPU INDIA DELHI PERU LIMA RUSSIA MOSCOW SPAIN MADRID

12. Write a program to search a name in the array and print it along with the telephone number. For e.g.
Names in the array are Ashoke, Vijay, Raman, Karim, Aman
Roll numbers in the array are 5, 48, 40, 25, 2
Searched name: Raman
Roll Number 40
13. Define a class TaxiMeter having the following description:
Data member / instance variable
int taxino – to store taxi number
String name – to store passenger’s name
int km – to store number of kilometers travelled
Member functions
TaxiMeter() – constructor to initialize taxino to 0, name to “ ” and b to 0
input() – to store taxino, name and km
calculate – to calculate bill for a customer according to given conditions: -
Kilometers travelled (km) Rate / km
1 km Rs 25
2 km to 6 km Rs 10 per km
7 km to 12 km Rs 15 per km
13 km to 18 km Rs 20 per km
More than 18 km Rs 25 per km
display() – to display the details in the following format:

Taxino Passenger’s Name Kilometers Travelled Bill Amount


--- --- --- ---

14. Design a class to overload a function area() as follows:


(i) double area(double a, double b, double c) with three double arguments, returns the area of a scalene
triangle using the formula:

(ii) double area(int a, int b, int height) with three integer arguments, returns the area of a trapezium using
the formula:
area = ½ x height (a+b)
(iii) double area(double diagonal1, double diagonal2) with two double arguments, returns the area of a
rhombus using the formula:
area = ½ (diagonal1 x diagonal2)
[Note: Write 1 program with three methods having the same name area() but with different parameters]

15. A class numMagic contains two methods Niven() and Digit(), the description of which is given below: -
boolean Niven(int n) - returns true if the number passed as parameter is a Niven number or returns
false if it is not. A Niven number is divisible by the sum of its digits.
For e.g., if the number is 6804 then the method returns true because 6804 is
divisible by 18 whereas if the number is 431 then the method returns false.

int Digit(int num) - returns the sum of the cube of the digits of the number passed as parameter.
For e.g. if the number is 563 then it returns,
=53+63+33
=125 + 216 + 27
= 368
Write a program in Java to define the above two methods by creating the object of the class.

16. Write a p rogram to p rint the su m of the terms in the seri es : -

17. Write a program to determine the greatest two digit number that has maximum factors. Print the number along
with its factors.
18. Write a program using parameter to input your year of birth in yyyy format and find the sum of the
digits.
If the sum is a one digit no. then add zero to the end of the number and double it. For e.g.
Year of birth = 2004
Sum = 2+0+0+4
=6
Joining zero = 60
Double = 60x2
=120
Whereas, if the sum is a two digit number then add a zero in between the digits and add 365 to it. For e.g.
Year of birth = 2009
= 2+0+0+9
= 11
Joining zero = 101
Adding 365 = 101+365
=466
For an invalid input print an appropriate message.
Use ‘switch – case’ to do the program.

19. Write a program to calculate the amount collected by an Internet Cafe based on the following conditions: -
Time (in hrs.) Amount (in Rs)
1 hr. Rs 20 only
>=2 hr. && <=4 hr. Rs 15 per hour
>=5 hr. && <=10 hr. Rs 10 per hour
Above 10 hrs. Rs 5 per hour
Number of hours worked in the Internet Cafe should be input as a parameter. For example,
Input:
Number of hours worked
= 12 hrs.
Output:
Total amount = Rs 135/-
1st hr. = Rs 20,
nd th
2 to 4 hr. = Rs 15 x 3
= Rs 45
5th to 10th hr. = Rs 10 x 6
= Rs 60
11th to 12th hr.= Rs 5 x 2
= Rs 10
Total = Rs 20 + Rs 45 + Rs 60 + Rs 10
= Rs 135/-

20. Declare two double dimensional 4x4 matrices A and B respectively and using scanner class store sixteen
numbers each in both of them. Declare a third matrix C of 4x4 nature and store the result in it by doing
simple calculation as shown below.
Matrix A Matrix B Resultant Matrix C

10 20 30 40 3 5 7 9 13 25 37 49
50 60 70 80 2 4 9 1 48 56 61 79
80 90 30 50 2 3 5 7 82 93 35 57
40 20 60 90 4 6 8 9 36 14 52 81

Note: Figures in 0th and 2nd row in the resultant matrix C are obtained by adding corresponding numbers
in matrix A and B whereas figures in 1st and 3rd row in the resultant matrix C are obtained by subtracting
corresponding numbers in matrix A and B.

You might also like