Class9CommApp 20250103093740
Class9CommApp 20250103093740
14) The act of representing essential features without including the background
details.
A) Abstraction C) Encapsulation
B) Inheritance D) Polymorphism
22) Which of the following is the size of a float data type in Java?
A) 8 bytes C) 2 bytes
B) 4 bytes D) 1 byte
53) What will be the output of the snippet if x=5 and y=10?
y=(x>=y)?++x:++y
A) 7 C) 11
B) 9 D)13
55) Which of the following loops is mostly used for fixed iterations?
A) for C) do-while
B) while D) if-else
64) The process of assigning a value to a variable for the first time
A) updation C) declaration
B) initialisation D) calculation
69) The picture given below represents which of the OOPS concepts.
71) The picture given below represents which of the following OOPS concepts.
a)Abstraction b)Encapsulation c)Polymorphism d)none of the above
Question
State the values of n and ch after executing the following code
char c=’c’;
int n=c+1;
char ch=(char)n;
int x=72;
char y=(char)x;
System.out.println(x+" "+y);
int a=1;
a = (a++) + (++a) *( - -a) -( a- -);
Write the equivalent java expression for the following mathematical expression
5 5 3
s= 10
+ 𝑥 +5𝑥
5 3
s= 𝑎𝑥 +𝑏𝑥 + c
2 2 2
T= (𝐴 + 𝐵 + 𝐶
2 2
𝑎 +𝑏
s= 2𝑎𝑏
3 4
X=|𝐴| + |𝐵| + (𝐴 + 𝐵 )
| 𝑎3+𝑏3 |
x= | 3 3 |
| 𝑎 −𝑏 |
3 𝑎+𝑏
s= 𝑎𝑏
3 3 𝑥𝑦
z= 𝑥 +𝑦 + 3
int s=0;
for(int x=1; x<=5; x+=2)
s+=x;
System.out.println(s);
int m = 5, n = 10;
while (n>=1)
{
System.out.println(m*n);
n–-; }
int x = 69;
int y = 89;
int z = 79;
int largestNumber = (x > y) ? (x > z ? x : z) : (y > z ? y : z);
Give the output of the following program segment and also mention how many times the loop is executed:
int i;
for (i = 5 ; i < 10; i++)
{
System.out.println(i);
}
System.out.println(i * 4);
JOHNSON GRAMMAR SCHOOL
MALLAPUR
ANNUAL REVISION
Class IX Subject: Computer Applications
PROGRAMS
1) Write a program to accept a integer and check whether it is perfect square or not
1. Ex: 25 sqrt=5.0 it is a perfect square
2. Ex : 3 sqrt=1.713 it is not a perfect square
2) Write a program to accept P, T and R values, find simple interest and compound interest and find their
difference.
SI S.I. = (Principal × Rate × Time)/100
3) The daily wages paid to a worker is rs 60/day.he works 3 days in the first week , 5 days in the second
week, 2 days in the third week and 7 days in the fourth week. Write a program to compute and
payment he gets in this month
4) Write a program , to convert a given temperature from Fahrenheit to Celsius (c = 5/9*(f-32)) and
Celsius to Fahrenheit (f = 1.8*c +32) (Accept appropriate values wherever required)
5) The distance between two electric poles is accepted in meters, calculate and print the distance in
kilometer and meter
6) Write a program to calculate the final salary after increment. Salary increment of employees based on
their basic pay.
BASIC PAY INCREMENT
Member Methods:
void accept() - To input the name of customer and number of units
consumed using Scanner class.
void calculate() - To calculate the bill as per the given criteria:
9) Write a program to input three angles of a triangle and check whether a triangle is possible or not. If
possible then check whether it is an acute-angled triangle, right-angled or an obtuse-angled triangle
otherwise, display 'Triangle not possible'.
Sample Input: Enter three angles: 40, 50, 90
Sample Output: Right=angled Triangle
10) An institution has decided to admit new candidates in different streams on the following criteria
11) Write a program to input the prize of the product and quantity purchased . calculate the total cost and
discount on total cost as per the given criteria.
TOTAL COST DISCOUNT
₹ 10000.00 5.5%
₹15000.00 7.5%
12) Mr. Kumar is an LIC agent. He offers a discount to his policy holders on the annual premium.
class name: Policyholder
Data Members:
name - to accept customer name
sum - to accept the sum assured
disc- to calculate discount
Member methods:
Input() - name(String), sum(double)
Calculate- find the discount amount based on the following criteria
Sum Assured Discount
Up to ₹ 1,00,000 5%
13) A DTDC Courier company charges for the pickles packing services for its customers as per the
following specification given below
Weight in Kgs Charge per kg
14) The volume of solids, cuboid, cylinder and cone can be calculated by the Formula:
a) Volume of a cuboid: (v = l × b × h)
b) Volume of a cone: (v = 1/3× π × r²× h) (π = 22/7)
Using a switch case statement, write a menu driven program to find the volume of different
solids by taking suitable variables and data types.
15) Write a program to accept a number and check and display whether it is a spy number or not. (A
number is spy if the sum of its digits equals the product of its digits.)
Example : consider the number 1124,
Sum of the digits = l + l+ 2 + 4 = 8
Product of the digits = 1×1 x2x4 = 8
16) Write a program to accept 25 characters using for() loop. Find and Print the following counters.
i) Number of Uppercase characters
ii) Number of Lowercase characters
iii) Number of Other characters
17) Write a program to input a number and check if it is a Nest number or not
Hint : A number is said to be a ‘Nest Number’ if the number contains at least one digit which is zero.”
Eg 1 Input : 2008 Output : It is a Nest Number
Eg 2 Input : 238 Output : Not a Nest Number
18) Using a switch case write a menu driven program to print the following
1. PATTERN:
11111
3333
555
77
9
2. Print the given series using a for loop.
10 2 30 4 50 6 … upto n terms