0% found this document useful (0 votes)
27 views8 pages

ICSE2022-23 PROJECT

The document outlines a Computer Applications project for Class X at Divine Mercy School for the session 2022-23. It includes various programming tasks such as creating classes for laptops and fruit juices, implementing algorithms for palindromes, searching arrays, and handling user input for different scenarios. Each task requires defining specific classes and methods to achieve the desired functionality in Java.

Uploaded by

gprodatta
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)
27 views8 pages

ICSE2022-23 PROJECT

The document outlines a Computer Applications project for Class X at Divine Mercy School for the session 2022-23. It includes various programming tasks such as creating classes for laptops and fruit juices, implementing algorithms for palindromes, searching arrays, and handling user input for different scenarios. Each task requires defining specific classes and methods to achieve the desired functionality in Java.

Uploaded by

gprodatta
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/ 8

Divine Mercy School

Session 2022-23 Class. X


COMPUTER APPLICATIONS PROJECT

Q1. An electronics shop has announced a special discount on the purchase of


Laptops as given below:

Category Discount on Laptop


Up to ₹25,000 5.0%
₹25,001 - ₹50,000 7.5%
₹50,001 - ₹1,00,000 10.0%
More than ₹1,00,000 15.0%

Define a class Laptop described as follows:

Data members/instance variables:

1. name
2. price
3. dis
4. amt

Member Methods:

1. A parameterized constructor to initialize the data members


2. To accept the details (name of the customer and the price)
3. To compute the discount
4. To display the name, discount and amount to be paid after discount.

Write a main method to create an object of the class and call the member
methods.

Q2. Write a program to accept a word and print whether the word is a palindrome or
only special word.
Q3. Write a program to initialize the seven Wonders of the World along with their
locations in two different arrays. Search for a name of the country input by the user.
If found, display the name of the country along with its Wonder, otherwise display
“Sorry Not Found!”.
Seven wonders - CHICHEN ITZA, CHRIST THE REDEEMER, TAJMAHAL,
GREATWALL OF CHINA, MACHU PICCHU, PETRA, COLOSSEUM
Locations -
MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN, ITALY
Example –
Country Name : INDIA Output : INDIA -TAJMAHAL
1. Country Name : USA Output : Sorry Not Found!

Q4. Define a class named FruitJuice with the following description:

Data Members Purpose


int product_code stores the product code number
String flavour stores the flavour of the juice (e.g., orange, apple, etc.)
String pack_type stores the type of packaging (e.g., tera-pack, PET bottle, etc.)
int pack_size stores package size (e.g., 200 mL, 400 mL, etc.)
int product_price stores the price of the product
Member
Purpose
Methods
constructor to initialize integer data members to 0 and string data
FruitJuice()
members to ""
to input and store the product code, flavour, pack type, pack size
void input()
and product price
void discount() to reduce the product price by 10
to display the product code, flavour, pack type, pack size and
void display()
product price

Q5. Design a class to overload a function series( ) as follows:


(a)double series(double n) with one double argument and returns the sum of the
series.
sum = (1/1) + (1/2) + (1/3) + .......... + (1/n)

(b)double series(double a, double n) with two double arguments and returns the
sum of the series.
sum = (1/a2) + (4/a5) + (7/a8) + (10/a11) + .......... to n terms

Q6. Design a class to overload a function polygon() as follows:

1. void polygon(int n, char ch) — with one integer and one character type
argument to draw a filled square of side n using the character stored in ch.
2. void polygon(int x, int y) — with two integer arguments that draws a filled
rectangle of length x and breadth y, using the symbol '@'.
3. void polygon() — with no argument that draws a filled triangle shown below:

Example:

1. Input value of n=2, ch = 'O'


Output:
OO
OO
2. Input value of x = 2, y = 5
Output:
@@@@@
@@@@@
3. Output:
*
**
***

Q7. Write a program by using a class to check if the input number is a Prime
Palindrome with the following specifications:

Class name — Calculate

Instance variables:

1. int num
2. int f
3. int rev
Member Methods:

1. Calculate(int n) — to initialize num with n, f and rev with 0 (zero)


2. int prime() — to return 1, if number is prime
3. int reverse() — to return reverse of the number
4. void display() — to check and print whether the number is a prime
palindrome or not

Q8. Write a program to assign a full path and file name as given below. Using
library functions, extract and output the file path, file name and file extension
separately as shown.
Input C:\Users\admin\Pictures\flower.jpg
Output Path: C:\Users\admin\Pictures\
File name: flower
Extension: jpg
Q9. Write a program in Java to accept a String in upper case and replace all the
vowels present in the String with Asterisk (*) sign.
Sample Input: "TATA STEEL IS IN JAMSHEDPUR"
Sample output: T*T* ST**L *S *N J*MSH*DP*R

Q10. Write a program to input integer elements into an array of size 20 and perform
the following
operations:
(i) Display largest number from the array.
(ii) Display smallest number from the array.
(iii) Display sum of all the elements of the array.
Q11. Write a program to generate a triangle or an inverted triangle based upon
User’s choice.

Example 1:
Input: Type 1 for a triangle and
Type 2 for an inverted triangle
Enter your choice 1
Enter a word : BLUEJ
Sample Output:
if choice is 1 Output will be

B
LL
UUU
EEEE
JJJJJ

if choice is 2 Output will be

BLUEJ
BLUE
BLU
BL
B

Q12. A string is said to be ‘Unique’ if none of the letters present in the string are
repeated. Write a program to accept a string and check whether the string is
Unique or not. The program displays a message accordingly.
Sample Input: COMPUTER
Sample Output: Unique String
Q13. Using the switch statement, write a menu driven program for the following:

(a) To print the Floyd’s triangle:


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

(b) To display the following pattern:


I
IC
ICS
ICSE

For an incorrect option, an appropriate error message should be displayed.

Q14. 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”. {1982, 1987, 1993, 1996, 1999, 2003,
2006, 2007, 2009, 2010}
Q15. Write a program to input two characters from the keyboard. Find the
difference (d) between their ASCII codes. Display the following messages:
If d=0 : both the characters are same.
If d<0 : first character is smaller.
If d>0 : second character is smaller.
Sample Input :
D
P
Sample Output :
d= (68-80) = -12
First character is smaller
Q16. Write a program that encodes a word into Pig Latin. To translate a word into
a pig Latin 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
Q17. Write a program to input two unequal positive numbers and check whether
they are perfect square numbers or not. If the user enters a negative number then
the program displays the message 'Square root of a negative number can't be
determined'.
Sample Input: 81, 100
Sample Output: They are perfect square numbers.
Sample Input: 225, 99
Sample Output: 225 is a perfect square number.
99 is not a perfect square number.
Q18. Write a program to input marks in English, Maths and Science of 40 students
who have passed ICSE Examination 2014. Now, perform the following tasks:
(a) Number of students, who have secured 95% or more in all the subjects.
(b) Number of students, who have secured 90% or more in English, Maths and
Science.
Q19. Write a menu driven program to accept a number from the user and check
whether it is a Prime number or an Automorphic number.
(a) Prime number: (A number is said to be prime, if it is only divisible by 1 and
itself)
Example: 3,5,7,11
(b) Automorphic number: (Automorphic number is the number which is contained
in the last digit(s) of its square.)
Example: 25 is an Automorphic number as its square is 625 and 25 is present as
the last two digits.
Q20. 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.
Sample Input: 15390
Sample Output: Sum of the digits = 18
For an incorrect choice, an appropriate error message should be displayed.
---------------------x-----------------

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy