0% found this document useful (0 votes)
24 views

Computer annual rev

The document outlines a series of programming exercises for Class IX students in Computer Applications, covering various topics such as mathematical calculations, conditional statements, loops, and data handling. It includes tasks like checking for perfect squares, calculating interest, converting temperatures, and creating a mini calculator. The exercises aim to enhance students' programming skills through practical applications in Java.
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)
24 views

Computer annual rev

The document outlines a series of programming exercises for Class IX students in Computer Applications, covering various topics such as mathematical calculations, conditional statements, loops, and data handling. It includes tasks like checking for perfect squares, calculating interest, converting temperatures, and creating a mini calculator. The exercises aim to enhance students' programming skills through practical applications in Java.
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/ 3

JOHNSON GRAMMAR SCHOOL

MALLAPUR CAMPUS
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

CI C.I. = Principal ((1 + Rate))/100Time − Principal

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) Without using if-else statement and ternary operators, accept three unequal numbers and display the
second smallest number. [Hint: Use Math.max( ) and Math.min( )]
Sample Input: 34, 82, 61
Sample Output: 61

7) Write a program to calculate the final salary after increment. Salary increment of employees based
on their basic pay.

BASIC PAY INCREMENT

Upto 5000 300/-

5001/- to 10000/- 550/-

10001/- to 15000/- 750/-

15001/- to 20000/- 1050/-

Above 20000 1500/-

8) Write a program to input a character . Convert the character into its opposite case .Print the original
and converted character.
Eg: input : G
Output : G g

9) Write a program to accept an alphabet and print its next five characters using a for() loop.

10) Define a method swap() which takes 2 character type arguments ch1 and ch2 interchange the values
of ch1 and ch2 . Print the values of ch1 and ch2 before and after interchange
Ex ch1 : B
ch2 : R
After interchange ch1 : R
ch 2 : B

11) 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
12) An institution has decided to admit new candidates in different streams on the following criteria
TOTAL MARKS OBTAINED STREAM OFFERED

300 Above Science

200 and above but less than 300 Commerce

Below 200 but not below 75 Arts

otherwise Admission not granted


Write a program to input name of the student , total marks obtained in a examination and print the
output as follows
NAME TOTAL MARKS STREAM OFFERED
******** ******************* *************************

13) 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

₹1000.00 to ₹5000 .00 3.0%

₹ 10000.00 5.5%

₹15000.00 7.5%

More than ₹30000.00 10.0%


Calculate the net amount to be paid after discount.print the price , quantity , total cost, discount and
net amount to be paid.

14) 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%

₹ 1,00,001 and up to ₹ 2,00,000 8%

₹ 2,00,001 and up to ₹ 5,00,000 10%

More than ₹ 5,00,000 15%


display()- to print all the details
Name of the policy holder :
Sum assured :
Discount :

15) Create a mini calculator. Enter two numbers ( a, b). Enter a choice ( ch). Perform add, subtract,
multiply and divide upon the value of choice being + , - , * , / .Use switch..case statement.

16) Write a program to accept the weight. Calculate the charge of a transport company according to the
following criteria:
Weight Rate
first 100 Kg Rs. 10/Kg
For the next 50 Kg Rs. 7/Kg
Above 150 Kg Rs. 5/kg
Display the details in the following format:
Weight Total cost
_______ _________

17) 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 cylinder: (v = π× r²× h)
c) 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.

18) 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

19) Write a Java program to check whether the entered number is a composite number or not? (Hint:
Composite numbers are having more than 2 factors)

20) 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

21) 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

22) Write a program to accept any 20 numbers and display only those numbers which are prime.
Hint: A number is said to be prime if it is only divisible by 1 and the number itself.

23) 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

24) a) Print the series 5 8 11 14 17 ……………….. Ten terms (3n+2)


𝑥+1 𝑥+2 𝑥+3 𝑥+4 𝑥+𝑛
b) Print the sum of the series 5! + 10! + 15! + 20! ……………… 5𝑛!
c) Print the series 1.5, 3.0, 4.5, 6.0,7.5……. 20 terms ( using do while loop)
d) Print the series 0 1 3 7 15 31 ……………………… (2n-1) ------- Accept n value for the last term
e) Print the series 1 12 123 1234 12345 ……………….. nth term

25) Write a program to print the following patterns using 2 methods

a) 1 b) F E D C B A
10 FEDCB
101 FEDC
1010 FED
10101 FE
F

You might also like