Computer Practice Questions Icse Java
Computer Practice Questions Icse Java
CLASS - X
A rent of ₹ 375 is charged as well as a tax of 15% on the total bill for each customer.
Compute the bill.
2. Write a program in Java to enter a number and check whether the number is an
Armstrong number or not.
(A number is said to be Armstrong if the sum of the cubes of its digits is equal to the
original number)
Sample input: 153
Sample output : 153 is an Armstrong number because 13+53+33=153
3. Write a program to display the first ten terms of the following series:
a. 1, 11, 111, 1111,……
b. 0, 3, 8, 15,……..
5. Write a program to generate a triangle or an inverted triangle till n terms based upon the
user’s choice.
Example 1 Example 2
Input: Type 1 for a triangle and Type 2 for Input: Type 1 for a triangle and Type 2 for
inverted triangle inverted triangle
Enter your choice: 1 Enter your choice: 2
Enter the number of terms 5 Enter the number of terms 6
Sample output: Sample output:
1 666666
22 55555
333 4444
4444 333
55555 22
1
6. Using switch case statement, write a menu driven program to:
a. Find and display all the factors of a number input by the user (including 1 and
excluding the number itself).
Example: Sample input : n = 15
Sample output : 1, 3, 5
b. Find and display the factorial of a number input by the user (the factorial of a non-
negative integer n, denoted by n!, is the product of all integers less than or equal
to n.
Example: Sample input :n=5
Sample output : 5! = 1*2*3*4*5 = 120
7. WAP to input integer elements into an array of size 20 and perform the following
operations. Display –
a. The largest no.
b. The smallest no.
c. Sum of all the elements.
8. WAP to accept 20 different numbers in a SDA. Now, enter a number and search whether
the number is present or not in the list of array by using the ‘Linear Search’ technique.
10. WAP to enter a sentence in mixed case and print a new string after converting upper to
lower and lower to upper case.