Computer Science – Programs for practice
Student name: ____________________ Grade: 9 IC
Worksheet : 1
Topic : Basic programs in Java
Here are 15 basic programs in Java that cover various programming concepts. These
programs cover a range of basic programming concepts and can serve as a foundation
for further exploration and learning in Java programming.
1. Write a program to find sum of two numbers.
2. Write a program to calculate average of three numbers.
3. Write a program to subtract two numbers and display the result.
4. Write a program to print area of a circle.
5. Write a program to multiply two numbers and display the result.
6. Write a program to divide a number by another one and display the result.
7. Write a program to find the area of a cuboid.
8. Write a program to find the value of the given expression.
p=(a+b)/c
9. Write a program to calculate the remainder when a number is divided by
another number and display the result.
10. Write a program to find the simple interest.
11. Write a program to concatenate first name and second name. And display
the full name.
12. Write a program to find area and perimeter of a rectangle.
13. Write a program to convert minutes to seconds.
14. Tim went to the store and bought a book for $15, a pen for $2, and a
notebook for $5. How much money did Tim spend in total?
15. Write a program to concatenate two strings.