You are on page 1of 5

HOLIDAY HOMEWORK

CLASS X
COMPUTER APPLICATIONS
Write the following programs in computer practical file (include
sample input and output, variable description and comments)
General programming and decision making in Java
1) Atul Transport charges for carrying parcels as per the city and weight. The tariff is
given below:
City

Weight

Kolkata

Upto 100 kg
>100 kg
Upto 100 kg
>100 kg
Upto 100 kg
>100 kg
Upto 100 kg
>100 kg

Mumbai
Chennai
Delhi

Charges (Rupees
per kg)
45
75
65
95
75
115
90
125

WAP to input city name K for Kolkata, M for Mumbai, C for Chennai ,D for Delhi
and the weight of the parcel. Calculate and display the charges to be paid by a
customer for booking.
2) WAP in Java to compute charges for sending parcels when the charges are as
follows : For the first 1 kg, Rs. 15.00 and for every additional weight , for every 500
gm or fraction thereof , Rs. 8.00. The user will input the weight of the parcel.
3) To foster a sense of water conservation, the water department has an annual water
conservation tax policy. The tax rates are as follows:
Water consumed (in
Gallons)
Upto 45
More than 45 but 75 or less
More than 75 but 125 or
less
More than 125 but 200 or
less
More than 200 but 350 or
less
More than 350

Tax rate in Rs./100


gallons
No tax
475
750
1225
1650
2000

WAP to compute and display an annual water tax chart based on input value of
water consumption.

4) Enter the record of employees of a company as employee number, age and basic
salary. WAP to calculate monthly gross salary and net salary of each employee as
follows:
Dearness Allowance
House rent allowance
Provident fund
Employee provident fund

Nature
40% of basic salary
12% of basic salary
2% of basic salary

Gross salary= Basic + HRA


Net Salary = Gross salary ( PF + EPF)
The program further checks whether an employee is an Income tax payer or not as
under depending on Annual gross salary
Male (M) upto Rs 1,50,000 Not an Income tax payer
Female (F) upto Rs 2,00,000 Not an income tax payer
Enter M or F to check the category and decide whether an employee has to pay
income tax or no. Print Employee number, gross salary, net salary and also Income
tax payer or not.

5) A special 2- digit number is such that when the sum of its digits is added to the
product of its digits, the result is equal to the original 2-digit number.
Example : Number =59
Sum of digits = 5+9 =14
Product of digits = 5*9 =45
Total of sum and product = 14+45 = 59
WAP to accept a 2-digit number. Add the sum of its digits to the product of its
digits. If the value is equal to the number input, output the message special 2digit number otherwise output the message, not a special 2-digit number.
6) Using a switch-case statement , write a menu-driven program to convert a given
temperature from Fahrenheit to Celsius and vice-versa. For an incorrect choice,
appropriate error message is displayed.
C= (5/9) * (F-32)
F= 1.8 * C +32
7) Write a menu driven program that outputs the result of following evaluations based
on the number entered by the user : (a) natural logarithm of the number (b)

Absolute value of the number (c) square root of the number (d) random numbers
between 0 and 1

8) An electronics shop has announced the following seasonal discounts on purchase


of certain items.
Category

Discount on laptop

Upto Rs. 25,000


Rs 25,001-57,000
Rs 57,001- 1,00,000
More than Rs
1,00,000

0.0%
5.0%
7.5%
10%

Discount on desktop
PC
5.0%
7.5%
10%
15%

WAP based on above criteria to input name, address, amount of purchase and type of
purchase(L for laptop and D for desktop). Compute and print the net amount to be
paid by a customer with his name and address.
Discount = (discount rate / 100)*amount of purchase
Net amount= amount of purchase- discount

Iteration through loops


1) Write a menu driven class to accept a number from the user and check whether
the number is perfect or palindrome.
Perfect number : A number is said to be perfect , if the sum of the factors
(including 1 and excluding the number itself) is same as the original number.
Example : number 6 is perfect
Factor of 6 = 1,2,3 and 1+2+3= 6
Palindrome number : A number is palindrome which when read in reverse order is
same as in the right order. Example : 11, 101, 252
2) WAP to display the following pattern:

54321
4321
321
21
1

3) WAP to compute the sum of following series:

S=

1+2
12

1+2+3
123

+ .. +

1+2+3+ ..+ n
123 ..n

4) WAP to calculate and print the sum of odd numbers and sum of even numbers for
the first n natural numbers.

5) The International standard book number(ISBN) is a unique numeric book identifier


which is printed on every book. The ISBN is based upon a 10 digit code. The ISBN is
legal if 1*digit1 + 2*digit2 + 3*digit3++10*digit10 is divisible by 11.
Example : for ISBN 1401601499 sum=
1*1+2*4+3*0+4*1+5*6+6*0+7*1+8*4+9*9+10*9 = 253 which is divisible by 11.
WAP to input the ISBN code as a 10 digit integer.
If the ISBN is not a 10 digit integer, output the message, Illegal ISBN and
terminate the program
If the number is 10 digits, compute the sum as above.
o If the sum is divisible by 11, output legal ISBN
o If the sum is not divisible by 11, output, illegal ISBN.
6) Using a switch statement write a menu driven program to
Generate and display the first 10 terms of 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 previous two
Find the sum of the digits of an integer that is input
Sample input: 15390
Sample output: sum of digits = 18
7) Write a menu driven program to accept a number from the user and check whether
it is a BUZZ number or to accept any 2 numbers and print the GCD of them
A buzz number is the number which either ends with 7 or is divisible by 7.
GCD of 2 integers is calculated by continued division method. Divide the larger
number by the smaller, then remainder divides the previous divisor. The
process is repeated till the remainder is zero. The divisor then results the GCD.
8) Write a menu driven program to perform the following tasks by using switch case
statement:
To print the series :
0,3,8,15,24 ..to n terms . n is entered by the user.
To find the sum of series :
S= 1/2 + 3/4 + 5/6 + 7/8 +.+ 19/20

9) WAP to print the Pascals triangle


1
121
12321

1234321
123454321

You might also like