0% found this document useful (0 votes)
132 views

Computer Applications Project-Class X SESSION 2021-22

The document provides 19 questions for computer application projects to be completed by students in two batches by specified deadlines. The questions cover a range of programming concepts like displaying series, word counting, checking number properties, pattern printing, encoding, menu driven programs, object oriented programming, and sorting algorithms. Students are asked to write the question, program, algorithm, sample input-output and comments for each question.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views

Computer Applications Project-Class X SESSION 2021-22

The document provides 19 questions for computer application projects to be completed by students in two batches by specified deadlines. The questions cover a range of programming concepts like displaying series, word counting, checking number properties, pattern printing, encoding, menu driven programs, object oriented programming, and sorting algorithms. Students are asked to write the question, program, algorithm, sample input-output and comments for each question.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

COMPUTER APPLICATIONS

PROJECT- CLASS X
SESSION 2021-22

Execute the following programs and submit the documentation of the program.
Write the question, program, algorithm, VDT, output and comments (atleast 5) for
each program. First 20 programs to be submitted by 30th July, 2021 and the last 15
programs by 30th November, 2021.

Q1.Display the following series : (Preferably by arithmetic method).


a. ½ + ¾ + ⅚ + ⅞ + ……+ 19/20
b. 0, 3, 7, 15, 24, ….n terms
c. 1! + 4! + 7! + ….n terms
Q2. Using Scanner class, write a program to accept a sentence and display the words
beginning with character ‘ch’ (input from user) with its frequency.
eg.Sample Input :MRS. ARORA IS AN ELECTIVE ENGLISH TEACHER.
ch= ‘E’
Sample Output : 2 WORDS BEGIN WITH CHARACTER ‘E’
ELECTIVE, ENGLISH
Q3. WAP to check whether a number is a Pronic Number or not .
PronicNumber : A pronic number, oblong number, rectangular number or heteromecic
number, is a number which is the product of two consecutive integers, that is,
n (n + 1). 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, 272, 306, 342, 380,
420, 462 … etc.

Q4. Input a number and check whether the number entered by the user is an Evil
number or not. An Evil number is one whose Binary counterpart has even number of
ones. E.g. 10, as the binary of 10 is 1010 which has 2 ones (hence Evil), whereas
numbers that has Odd number of 1’s are called Odious numbers

Q5. Display the following patterns:


a. *
* *
* * *
* * * *
* * * * *
b. 1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
c. 5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
Q6. To check whether the number is a magic number or not.
[ e.g.  172 = 1+7+2 =10
            10 = 1+0 = 1 ]
( If the ultimate result is 1 then it is a magic number).

Q7. Write a program to input a sentence and display the largest and smallest word
present in it. (first to be encountered)
Sample input: Australia is the largest continent in the world.
Sample output: largest: Australia
smallest: is
Q8. 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

Q9. WAP that outputs the results of the following evaluations based on the choice
entered by the user:
a. prints the factors of a number taken as input by the user
b. print the factorial of the same number
c. check if the same number is prime or not
d. check if the same number is perfect or not
e. check if trhe same number is palindrome or not

Q10. Design a class overloading a function calculate () as follows:


(i) void calculate( int m, char ch) to check whether the number is divisible by 7 or not, if
ch is 's' otherwise, it checks the last digit of the integer argument contains 7 or not
(ii) void calculate (int a, int b, char ch) which displays the greater of integer arguments
if ch is 'g' otherwise, display smaller of the integer arguments

Q11. Write a program in JAVA to find the Prime factors of a number.


Prime factors of a number are those factors which are prime in nature and by which the
number itself is completely divisible (1 will not be taken as prime number).
Few such numbers are:
Prime Factors of 24 are 2, 2, 2, 3
Prime Factors of 6 are 2, 3

12. Mr.X has a savings bank account in BOI. He wants to make transaction from his
account either by depositing some money or by making withdrawals.
Write a program to perform the above task with the following details.
Class name : SavingsAccount
Data members :
String name, ac_type
intacno
floatbalance
Methods :
SavingsAccount(intbal) : assign bal to balance
void deposit(intamt) : deposits amt and update balance
void withdraw(intamt) : withdraws amt and maintains balance.
However, if the balance becomes less than Rs. 500 then the function should
display an error message “insufficient balance” and should not allow the
user to withdraw.
void display() : displays balance of the account holder.

Q13. Define a class ‘Telephone’ having the following description:


Instance Variables / Data Members:
intprv - to store the previous and present meter reading int call
intpre - to store the calls made (i.e. pre – prv)
String name - to store name of the customer
doubleamt - to store the amount
doubletotal - to store the total amount to be paid

Member Methods:
void input ( ) - to input the previous reading, present reading and name of the
customer
voidcal ( ) - 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
Up to 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 Rs. 180 per month as monthly rent for availing the
service.

Q14. Write a program in Java to read two numbers and check if they are co-prime
numbers or not. Use the following functions in your program-
int cacl_hcf(int, int) - finds HCF of two numbers
int prime (int) - returns 0 if not prime otherwise 1
[Note: A co-prime numbers are numbers which are both prime and their HCF is 1]
Q15. An ISBN ( InternationalStanadar Book Number) is a ten digit code which
uniquely identifies a book. The first nine digits represent the Group, Publisher and Title
of the book and the last digit is used to check whehter ISBN is correct or not. Each of
the first nine digits of the code can take a value between 0 and 9. Sometimes it is
necessary to make the last digit equal to ten; this is done by writing the last digit of the
code as X. To verify an ISBN, calculate 10 times the first digit, plus 9 times the second
digit, plus 8 times the third and so on until we add 1 time the last digit. If the final
number leaves no remainder when divided by 11, the code is a valid ISBN. 
For example: 
1. 02011003311 = 10*0 + 9*2 + 8*0 + 7*1 + 6*1 + 5*0 + 4*3 + 3*3 + 2*1 + 1*1 = 55 
Since 55 leaves no remainder when divisible by 11, hence it is a valid ISBN. 
Design a program to accept a ten digit code from the user. For an invalid inout, display
an 
appropriate message. Verify the code for its validity in the format specified below: 
Test your program with sample data and some random data. 
Example 1 
INPUT CODE : 0201530821 
OUTPUT : SUM = 99 
LEAVES NO REMAINDER - VALID ISBN CODE 

Q16. Write a program to accept 15 integers from the keyboard, assuming that no
integer entered is a zero. perform Selection Sort on the integers and then print them in
ascending order
 Q17. Design a Calculator class that performs calculations only on integer values. Some
functions and data members are given below:
Data member: result
Default constructor: to Create an object with default value of result.
Copy constructor: Creates a duplicate of an existing object of the class.
inputValue(int x): to enter the first operand
display(): to display the result
add(int x): to add argument to the result
multiply(int x): to multiply the argument with the result
setZero(): to set the result to value 0.

Q18. Write a menu driven program to accept a number and check and display whether
it is a prime number, automorphic number or perfect number.
a. Prime number: a number is said to be a prime number if it is divisible
only by 1 and itself and no other number. Example: 3, 5, 7, 11, 13, etc.…
b. Automorphic number: An automorphic number is the number which is
contained in the last digits of its square. Ex: 25 is automorphic as its
contained in its square 625
c. Perfect number: Perfect number is a number if it equals to the sum of its
factor other than the number itself. Example 6=1+2+3
Q19 . Create a class called Points with the following specifications-
Class name : Points
Data members
private x1,y1,x2,y2 : variables to store values of the coordinates

Methods
public Points() : default constructor
public Points (int x1, int y1) : assigns value to x1 and y1 coordinates
public Points (int x1, int y1, int x2, int y2): assigns x2 and y2 coordinates directly
and x1 and y1 coordinates by calling Points(int x1,
int y1) constructor
public long distance() : calculates and returns the distance between two
points using formula
distance = √ ❑
public int getX1() : returns the value of x1 coordinate
public void showPoints() : displays Points in the following format
Point1 (x1,y1) , Point2 (x2, y2)
Write main() to call the methods.

Q20. Write a program in Java to find the Roman equivalent of any Decimal number
entered by the user. [The number entered should be within the Range 1-100]

Brief Note on Roman Numerals: The Roman numerals follow this basic pattern,

100 = C, 90 = XC, 50 = L, 40 = XL, 10 = X, 9 = IX, 5 = V, 4 = IV, 1 = I

Q21. Write a program to read a string and convert it to uppercase. Count and output
the consecutive letter pairs that exist in the string.

Eg- IT WAS NOT TOUGH FOR HIM TO RESIDE ABOVE THE HILL

OUTPUT: NOT, TOUGH, HI, RESIDE, ABOVE, HILL

Q22. The English Teacher of a primary school wants her children to identify the letters
used in a paragraph uniquely and arrange them in alphabetical order. Write a Java
program that reads a string from the user and generates a set of unique letters by
removing the duplicates. The program should print the unique set of letters
alphabetically.
Ex: Input- assessment
Output-
Unique letters – asemnt
Alphabetically – aemnst

Q23. Designs functions:


i. int factorial(int x): to find and return the factorial of number and stored in x.
ii. void IsSpecial(int arr[]): the function gets an array arr[] and by invoking
function factorial() print only special numbers from the array.
Write a main function to input 20 integers in an array and invoke the functions.
(A number is said to be special if sum of factorials of each digit of the number is
equal to that number)

Q24. The editor of a news paper company needs to edit write-ups sent by the
correspondents frequently. Help her to device a method in Java that reads a string and
a subpart1 from the user and search if the subpart1 is found in the main string. It reads
another string, subpart2 which will replace subpart1 in the main string. The method
should display a suitable message if the subpart1 is not found in the main string.
Do not use replace() / replaceAll() method to solve the problem.
Eg. Input – mimicry is a special mistery art in mindful people
Subpart 1: mi
Subpart 2: mo
Output: momocry is a special mostery art in mondful people

Q25. Write a program to identify common elements or numbers between two given
arrays.
Example:
int[] arr1 = {4,7,3,9,2};
        int[] arr2 = {3,2,12,9,40,32,4};
Output:
4
3
9
2
Q26. Write a program in Java to store the numbers in a 3*4 matrix in a DDA. Find the
sum of all the numbers of the matrix and display the sum using an input statement.
Sample Output:
The numbers of the matrix are:
1234
5678
9 10 11 12
The sum of the elements in the matrix is 78.

Q27. Design a class to overload print() as follows:

void print(int x, int y) - prints odd number between x and y


void print(char ch1, char ch2) - prints all the consonants between ch1 and ch2

void print(char ch, int n) -to print the character ch for n number of times in the given

format. Ex- ch=& and n =4

&&&&

&&&

&&

&

Q28. Write a program in Java to create a 3*3 Square Matrix and store numbers in it.
The programmer should check whether the Matrix is Symmetric or not. A Square
Matrix is said to be Symmetric if the element of the ith row and jth column is equal to
the element of the jth row an ith column. E.g., A Symmetric Matrix:
123
245
356

Q29. Write a program in Java to store 10 numbers (including positive and negative
numbers) in a Single Dimensional Array (SDA). Display all the negative numbers
followed by the positive numbers without changing the order of the numbers.
Sample Input:

n[0] n[1] n[2] n[3] n[4] n[5] n[6] n[7] n[8] n[9]

15 21 -32 -41 54 61 71 -19 -44 52

Sample Output: -32, -41, -19, 44, 15, 21, 54, 61, 71, 52

Q30. Write a program in Java to store 20 numbers in a Single Dimensional Array


(SDA). Display the numbers which are prime.

Sample Input:

n[0 n[1 n[2 n[3 n[4 n[5 .. n[16] n[17] n[18] n[19]
] ] ] ] ] ] .

45 65 77 71 90 67 .. 82 19 31 52
.
Sample Output: 71, 67, 19, 31

Q31. Write a program to accept the year of graduation from school as an integer value
from the user. Using the binary search technique on the sorted array of integers given
below, output the message "Record exists" if the value input is located in the array. If
not, output the message "Record does not exist".
Sample Input:
n[0] n[1] n[2] n[3] n[4] n[5] n[6] n[7] n[8] n[9]

1982 1987 1993 1996 1999 2003 2006 2007 2009 2010

Q32. Write a program to accept a list of 20 integers. Sort the first 10 numbers in
ascending order and next the 10 numbers in descending order by using 'Bubble Sort'
technique. Finally, print the complete list of integers.

Q33. Write a program in JAVA that reads the following list of countries and their
respective cities into two separate one-dimensional arrays. The program should accept
the name of a country as input and give the name of the corresponding city as an
output. The program should be designed to give an error message where a city is asked
for a country whose name is not given in the list. To stop the program, "XXX" is to be
entered as input.
    GERMANY       BERLIN
    NEPAL         KATMANDU
    JAPAN         TOKYO
    CANADA        MONTREAL
    IRAQ          BAGHDAD
   
Q34. Write a JAVA program to accept the temperature of any 10 cities in degrees
Fahrenheit. Convert temperature to degree centigrade using the given formula:
Centigrade  =  (Fahrenheit - 32) X 5/9Display the information in the given format. Also
at the end print the total number of cities where the temperature is more then 35 degree
centigrade and the city name with maximum temperature.
   City Name    Fahrenheit Temperature    Centigrade Temperature
   ---------    ----------------------    ----------------------

Number of cities more then 35-degree centigrade temperature:


Name of the city with maximum temperature:
Q35. Write a program in JAVA to accept the name and marks in computer science of
forty students in an array and then print the name and marks of students according to
their merit (decreasing order of marks).

You might also like