0% found this document useful (0 votes)
4 views2 pages

Wa0000.

This document is a practice set containing various Java programming exercises aimed at students. It includes tasks such as initializing variables, performing arithmetic operations, calculating areas and perimeters of shapes, converting units, and calculating financial metrics like salary and interest. The exercises are designed to enhance programming skills and understanding of basic mathematical concepts.

Uploaded by

sidrasaif04
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)
4 views2 pages

Wa0000.

This document is a practice set containing various Java programming exercises aimed at students. It includes tasks such as initializing variables, performing arithmetic operations, calculating areas and perimeters of shapes, converting units, and calculating financial metrics like salary and interest. The exercises are designed to enhance programming skills and understanding of basic mathematical concepts.

Uploaded by

sidrasaif04
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/ 2

JAVA

(A collection of previous year’s programs of different schools)


Practice Set-3
(Write programs and Flowcharts)
1. WAP to store / Initialize 3 integer type variables and display them.
2. WAP to store your name and class in two variables and display.
3. WAP to input Name, Age and Date of Birth and Display using Input Method (Streams and
Buffers)
4. WAP to initialize / input three numbers and display their sum.
5. WAP to find the sum, product, difference & quotient of two numbers (initialize / input)
6. WAP to input / Initialize 2 nos. and store their sum in ‘s’ and product in ‘p’ and display both
of them.
7. WAP to Store the value of side of a square and display the Area & Perimeter of the Square.
8. WAP to store / input the length and breadth of a Rectangle, calculate and print the area and
Perimeter of Rectangle
9. WAP to store / input the radius of a Circle, and calculate the Area and Circumference using
the formula Area =π.R2 and Circumference = 2 π.R
10. WAP to input the marks obtained by a student in English, Hindi, Maths, Science, History,
Geography, Computers and Bengali and calculate the Total and Aggregate marks obtained by a
student in the 8 subjects.
11. WAP to input the values of resistances R1 and R2 and find out the total equivalent
resistance in a circuit in which the 2 resistors are connected in series
(Series = R1 + R2) and when they are connected in parallel,
(Parallel = (R1*R2) / (R1+R2))
12. WAP to input the two angles of a triangle and find the 3rd angle
13. WAP to find out the value of distance (s) covered by a body, where s = ut + ½ at2 , value of
u, a and t are provided by the user.
14. WAP to input the distance in meter and convert it into to centimeters.
15. WAP to input the time in hours and convert it into minutes and seconds.
16. WAP to input the time in seconds and split it into hours, minutes and seconds.
17. WAP to find out the distance covered by light in One Year (Speed light = 3 x 108 m/s)
18. WAP to input the distance covered by a body along with time and calculate the Speed
19. WAP to input the speed in km/hr and convert it into m/s.
20. WAP to input distance in km and convert it into yards (1 yard = 0.9144 m) and vice versa.
21. WAP to input the temperature in Centigrade and convert it into to Fahrenheit and vice
versa,
Formula : C/5 = (F – 32) /9
22. If ‘m’ and ‘v’ denote the mass and velocity of any moving object WAP to input the values of
‘m’ and ‘v’ and find out the Kinetic Energy of a body which is given by the formula (KE = ½ mv2)
23. WAP to find out the Potential Energy given by the formula (PE= m*g*h) where the values of
m, g and h are entered by the user.
24. WAP to input the Base and Height of a Right angled Triangle and calculate the Area using
the formula
Area = ½ Base X Height
25. WAP to the convert the amount entered by the user in denominations of Rs. 1000, Rs. 500,
Rs. 100, Rs. 50, Rs. 20, Rs. 10, Rs. 5, Rs. 2 and Re.1 notes (Note : denominations should be least
JAVA
(A collection of previous year’s programs of different schools)
Practice Set-3
(Write programs and Flowcharts)
possible numbers)
26. Write a program to find all the remainders when a number ‘n is divided by any number from
1 to 9
27. Write a program that takes the three ‘sides’ of a cube as input and displays the TSA and
Volume of the same.
(Hint TSA = 6 * side * side) (Vol. = side * side * side)
28. WAP to swap the values stored in two variables (using a third variable) Display the values of
the two variables before and after swapping.
29. WAP to swap the values stored in two variables (Without using a third variable) Display the
values of the two variables before and after swapping.
30. Write a program to input the price of 1 pen and 1 eraser and calculate the total cost of 15
pens and 14 erasers.
31. WAP to input the Basic Salary of an employee and Calculate his Gross and Net Salary based
on the information given below
D.A. (Dearness Allowance) = 75% of Basic Salary
H.R.A. (House Rent Allowance)= 20% of Basic Salary
P.F. (Provident Fund) = 17% of (Basic + D.A.)
Gross Salary = Basic + D.A + H.R.A
Net Salary = Gross Salary – P.F.
32. WAP to input the Principal, Rate and Time and calculate the Simple Interest and Amount
33. WAP to input the Principal, Rate per-annum and Time along with the compounding
frequency in a year and calculate the Compound Interest and Amount.
34. Hathaway TV allows a discount of 20% on a monthly recharge of a channel pack. For the
same channel pack Tata Sky offers two successive discounts of 20% and 10%. WAP to input the
recharge amount and display which company is providing a cheaper deal.

You might also like