Std10 Computer Project 23 24
Std10 Computer Project 23 24
Std10 Computer Project 23 24
Note : Write question, program and variable description for each question IN
THE SAME ORDER
3 Write a Java program to print the first 15 numbers of the Pell series. In
mathematics, the Pell numbers are an infinite sequence of integers. The
Sequence of Pell numbers starts with 0 and 1, and then each Pell number is
the sum of twice the previous Pell number and the Pell number before that.:
Thus, 70 is the companion to 29, and 70 = 2 x 29 + 12 = 58 + 12. The first few
terms of the sequences are: 0, 1, 2, 5, 12, 29, 70, 169, 408, 985, 2378, 5741,
13860…
4 Using a switch statement , write a menu driven program to find the sum of the
following series.
Series 1:
S = 1 + 2 - 3 + 4 - 5 + 6 - 7 + 8 - 9 + ……………… -15
Series 2:
S = (X+1)2+(X+2)3+(X+3)4+(X+4)5+…………… +(X+N)N+1
For an incorrect choice , an appropriate error message should be displayed.
Member methods:
void input() : to accept name of the book printed price of the book
void cal() : to calculate fine to be paid
void display() : display name of the book and fine to be paid
Write the main method to create an object of the class and call the above
member methods.
Member Methods:
void input ( ) - to input the previous reading, present reading and name of
the customer
void cal ( ) - to calculate the amount and total amount to be paid
void display ( ) - to display the name of the customer, calls made, amount
and total
amount to be paid in the following format:
Name Calls Made Amount Total Amount
……......... ......……..…….. ……......…….. ……........……....
Write a program to compute the monthly bill to be paid according to the
given conditions:
Calls made Rate
Upto 100 calls No Charge
For the next 100 calls 90 paise per call
For the next 200 calls 80 paise per call
More than 400 calls 70 paise per call
However every customer has to pay 180 per month as monthly rent for
availing the service.
Member methods:
void input() : stores the Principal, rate , time
void cal() : calculate the interest and amount prepaid
void display() : display the principal interest and amount to be paid
Time rate of interest
for one year 6.5%
for 2 years 7.5%
for 3 years 8.5%
for 4 years and more 9.5%
(Note : Time to be taken only in whole years)
9 An Abundant number is a number for which the sum of its proper factors is
greater than the number itself. An deficient number is a number for which
the sum of its proper factors is smaller than the number itself . Write a
program to input a number and check and print whether it is an Abundant or
deficient number or not.
Example:
10 A Dudeney number is a positive integer that is a perfect cube such that the
sum of its digits is equal to the cube root of the number. Write a program to
input a number and check and print whether it is a Dudeney number or not.
Example:
Sum of digits = 5 + 1 + 2 = 8
Cube root of 512 = 8
write a program read the data calculate and display the following
a) Average marks obtained by each student
b) Print the roll number and average marks of the students whose average is
above 80
c) Print roll number and the average marks of the students whose average is
below 80
12 Design a class to overload a function check() as follows:
(i) void check(String str, char ch) - to find and print the frequency of a
character in a string.
Example:
Input: Output:
str=“success” number of s present is =3
ch=‘s’
(ii) void check(String s1) - to display only vowels from string s1, after
converting it to lower
Case if it is in uppercase.
Example:
Input: Output:
s1=“cOmpUter” output : o u e
(iii) void check(int num) – to check the num is palindrome or not.
13 Write a program in Java to accept a String from the user. Print all the letters
of the word in alphabetical order.
14 Shasha Travels Pvt. Ltd. gives the following discount to its customers:
Write a program to input the name and ticket amount for the customer and
calculate and return the discount amount from in the function double
calculate(int a) where a is ticket amount. Calculate net amount and display
the output in the following format for each customer:
Write a program to input the names and marks of the students in the subject.
calculate and display
a) subject average marks( subject average marks = total marks / 50)
b) the highest marks in the subject and the name of the student( the
maximum marks in the subject are 100)
17 Write a program that encodes a word into Piglatin. To translate a word into a
Piglatin word, convert the word into uppercase and then place the first vowel
of the original word as the start of the new word along with the remaining
alphabets. The alphabets present before the vowel being shifted towards the
end followed by “AY”.
Sample Input (1) : London, Sample Output (1) : ONDONLAY
Sample Input (2) : Olympics, Sample Output (2) : OLYMPICSAY
18 Write a program that takes a sentence and count and print number of vowels,
consonants, numeric digits and special characters in a sentence. Assume
#,$,%,&,@ are special characters and ignore other special characters.
-----------------------------------------------