Page 242 - ComputerScience_Class_11
P. 242
14. Assume that new tax rates and deduction rules have been implemented as shown below:
Annual income (in `) Tax Rates for Females Tax Rates for Males
up to 100000 nil nil
100000 to 200000 10% 12%
200000 to 300000 20% 22%
300000 to 500000 30% 33%
Write a Java program to input employee id, annual income and gender (F for female and M for male). Compute the income tax
using the above criteria and print employee id, gender and tax amount.
15. Write a program to display the following pattern using switch case.
i. 1 ii. 1 2 3 4 5
3 1 6 7 8 9
5 3 1 10 11 12
7 5 3 1 13 14
15
16. Write a program to display the following pattern using switch case.
i. I ii. COMPUTER
I S COMPUTE
I S C COMPUT
COMPU
COMP
COM
CO
C
17. Write a program in Java to find the sum/product of the series given below:
s=1/2+1/4+1/6+1/8+.....+1/n
p=1 x a/2 x a/3 x a/4 x ....x a/n
s= 1+ (1+3) + (1+3+5)…..(1+3+5+…..n)
2
2
2
s= 1/1 + 1/2 + 1/3 …………1/n 2
2
2
2
p= 1/2 x 2/3 x 3/4 x………x n/(n+1) 2
2
3
n
4
s= 1+ (x /2) + (x /3) + (x /4) + ………..(x /n)
s= (1/1!) + (2/2!)+…….+(n/n!)
s= x+ (x /2!) + (x /3!)+…….n
2
3
p= 1/1 x 2/4 x 3/6 x 4/24 x…x n
s= 1x + 4x + 9x + 16x + 25x + … + nx
18. Write a program in Java to display all the prime Fibonacci series numbers upto n.
E.g., 2, 3, 5, 13, 233, etc.
19. Using switch case, write a program to print the following series (1st 10 terms)
Case 1: Triangular number series: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55
Case 2: Square number series: 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
Case 3: Cube number series: 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000
20. Write a program to input a number and print all the prime perfect number upto n. (Prime perfect number are those numbers
whose all the factors are prime)
E.g., 6 = 1 + 2 + 3
21. A school is allocates grade and remarks on the basis of total marks (total of 3 subject of 100 marks) obtained by the student as
per the following criteria:
Marks obtain Grade allocated Remark on grades
85 to 100 A Excellent
75 to 84 B Distinction
60 to 75 C Good
40 to 60 D Fair
less than 40 E Need improvement
Write a program to input 3 subject marks and print total marks, grade allocated and remark given.
240 Touchpad Computer Science (Ver. 3.0)-XI

