KARANVEER SINGH
CLASS IX SCIENCE
ROLL NO. 3
SUBJECT: COMPUTER APPLICATIONS
1
CONTENTS
Teache
r’s
Topic Page
Sl.N Signat
o ure
1. Acknowledgement
2. Introduction
3. System specification
4. Programming 1
5. Working of the program
6. Output
7. Programming 2
8. Working of the program
9. Output
10. Programming 3
11. Working of the Program
12. Output
13. Programming 4
14. Working of the program
15. Output
Programming 5
16.
17. Working of the program
18. Output
19. Programming 6
20. Working of the program
21. Output
22. Programming 7
2
23. Working of the program
24. Output
25. Programming 8
26. Working of the program
27. Output
28. Programming 9
29. Working of the program
30. Output
31. Programming 10
32. Working of the program
33. Programming 11
34. Working of the program
35. Output
36. Programming 12
37. Working of the program
38. Output
39. Programming 13
40. Working of the program
41. Output
42. Program 14
43. Working of the program
44. Output
45. Programming 15
46. Working of the program
47. Output
48. Programming 16
49. Working of the program
50. Output
3
51. Programming 17
52. Working of the program
53. Output
54. Programming 18
55. Working of the program
56. Output
57. Programming 19
58. Working of the program
59. Output
60. Programming 19
61. Working of the program
62. Output
63. Conclusion
64. Bibliography
4
ACKNOWLEDGEMENT
I would like to show my utmost thanks and gratitude to
our Principal Madam. I am also thankful towards our
Computer applications teacher, who have given me this
opportunity to do this project of various ICSE Java
programs of Class 9 , Session 2024-25. This project
really helped me to learn about different types of
programs and classes which helped me a lot to improve
my conceptual knowledge.
5
INTRODUCTION
I am presenting the project of ICSE Class 9 , Session
2024-25.
Java is a high-level, object-oriented programming
language developed by Sun Microsystems in 1995.
Known for its platform independence due to the Java
Virtual Machine (JVM), it enables “write once, run
anywhere” functionality. Java is widely used for building
web applications, mobile apps, and enterprise software.
It emphasizes portability, security, and robustness,
making it a popular choice for developers worldwide.
This project follows various java programs of ICSE Class
9 curriculum which contains different variables and
classes. The description of the program and the how
the program works is also given in the following project.
6
SYSTEM SPECIFICATION
Model: LG XNote series
Operating System: Windows 7 Home Premium (64-bit)
Processor: Intel Core i5-3210M (2.5 GHz, dual-core)
RAM: 4 GB DDR3 (expandable to 8 GB)
Storage: 500 GB HDD (7200 RPM)
Graphics: Intel HD Graphics 4000
Display: 14-inch LED-backlit LCD (1366 x 768)
Weight: Approximately 2.2 kg
7
PROGRAMMING
Program 1: Input 20 numbers and
display any possible factors of each
number
Source Code
Import java.util.Scanner;
Public class Factors {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Int[] numbers = new int[20];
System.out.println(“Enter 20 numbers:”);
For (int i = 0; i < 20; i++) {
Numbers[i] = sc.nextInt();
}
For (int num : numbers) {
System.out.print(“Factors of “ + num + “: “);
For (int j = 1; j <= num; j++) {
8
If (num % j == 0) {
System.out.print(j + “ “);
}
}
System.out.println();
}
}
}
Working of the Program
1. The program reads 20 integers into an array.
2. It loops through each number to calculate its
factors by dividing it with numbers from 1 to itself.
3. Any number that divides evenly (remainder 0) is
considered a factor and printed.
Output
9
Enter 20 numbers:
12 15 18 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90
95 100
Factors of 12: 1 2 3 4 6 12
Factors of 15: 1 3 5 15
Factors of 18: 1 2 3 6 9 18
...
Factors of 100: 1 2 4 5 10 20 25 50 100
Program 2: Test whether a number is a
perfect square
Source Code
Import java.util.Scanner;
Public class PerfectSquare {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter a number: “);
Int num = sc.nextInt();
10
Double sqrt = Math.sqrt(num);
If (sqrt == (int) sqrt) {
System.out.println(num + “ is a perfect
square.”);
} else {
System.out.println(num + “ is not a perfect
square.”);
}
}
}
Working of the Program
1. The program takes an integer input from the user.
2. It calculates the square root of the number using
Math.sqrt().
3. If the square root is an integer, it concludes the
number is a perfect square; otherwise, it is not.
11
Output
Enter a number: 16
16 is a perfect square.
Program 3: Display natural numbers in
order of user’s choice
Source Code
Import java.util.Scanner;
Public class NaturalNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of natural
numbers to display: “);
Int n = sc.nextInt();
System.out.println(“First “ + n + “ natural
numbers are:”);
For (int i = 1; i <= n; i++) {
12
System.out.print(i + “ “);
}
}
}
Working of the Program
1. The program asks the user how many natural
numbers they want to display.
2. It uses a loop to print numbers from 1 to the user-
provided number.
Output
Enter the number of natural numbers to display: 10
First 10 natural numbers are:
1 2 3 4 5 6 7 8 9 10
13
Program 4: Display odd numbers of user’s
choice
Source Code
Import java.util.Scanner;
Public class OddNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of odd
numbers to display: “);
Int n = sc.nextInt();
System.out.println(“First “ + n + “ odd numbers
are:”);
For (int i = 1, count = 0; count < n; i += 2, count+
+) {
System.out.print(i + “ “);
}
}
}
Working of the Program
14
1. The program asks the user how many odd numbers
to display.
2. It starts with 1 and increments by 2 to generate
odd numbers until the required count is reached.
Output
Enter the number of odd numbers to display: 5
First 5 odd numbers are:
13579
Program 5: Display even numbers of user’s
choice
Source Code
Import java.util.Scanner;
15
Public class EvenNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of even
numbers to display: “);
Int n = sc.nextInt();
System.out.println(“First “ + n + “ even numbers
are:”);
For (int i = 2, count = 0; count < n; i += 2, count+
+) {
System.out.print(i + “ “);
}
}
}
Working of the Program
1. The program asks the user how many even numbers
to display.
2. It starts with 2 and increments by 2 to generate
even numbers until the required count is reached.
16
Output
Enter the number of even numbers to display: 5
First 5 even numbers are:
2 4 6 8 10
Program 6: Display the square of natural
numbers of user’s choice
Source Code
Import java.util.Scanner;
Public class SquareOfNaturalNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of natural
numbers to display their squares: “);
Int n = sc.nextInt();
17
System.out.println(“Squares of the first “ + n + “
natural numbers are:”);
For (int i = 1; i <= n; i++) {
System.out.println(“Square of “ + i + “ = “ + (i *
i));
}
}
}
Working of the Program
1. The program takes an integer input from the user,
representing how many numbers to process.
2. It calculates the square of each natural number
from 1 to the user’s input using i * i.
3. It displays the results for each number.
Output
18
Enter the number of natural numbers to display their
squares: 5
Squares of the first 5 natural numbers are:
Square of 1 = 1
Square of 2 = 4
Square of 3 = 9
Square of 4 = 16
Square of 5 = 25
Program 7: Display the square of odd
numbers of user’s choice
Source Code
Import java.util.Scanner;
Public class SquareOfOddNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of odd
numbers to display their squares: “);
Int n = sc.nextInt();
19
System.out.println(“Squares of the first “ + n + “
odd numbers are:”);
For (int i = 1, count = 0; count < n; i += 2, count+
+) {
System.out.println(“Square of “ + i + “ = “ + (i *
i));
}
}
}
Working of the Program
1. The program asks the user how many odd numbers
to process.
2. It generates odd numbers starting from 1,
calculates their squares using i * i, and increments
the odd number by 2 each time.
Output
Enter the number of odd numbers to display their
squares: 5
20
Squares of the first 5 odd numbers are:
Square of 1 = 1
Square of 3 = 9
Square of 5 = 25
Square of 7 = 49
Square of 9 = 81
Program 8: Display the square of even
numbers of user’s choice
Source Code
Import java.util.Scanner;
Public class SquareOfEvenNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of even
numbers to display their squares: “);
Int n = sc.nextInt();
21
System.out.println(“Squares of the first “ + n + “
even numbers are:”);
For (int i = 2, count = 0; count < n; i += 2, count+
+) {
System.out.println(“Square of “ + i + “ = “ + (i *
i));
}
}
}
Working of the Program
1. The program takes the number of even numbers the
user wants to process.
2. It calculates the square of each even number
starting from 2, incrementing by 2 until the count is
reached.
Output
Enter the number of even numbers to display their
squares: 5
Squares of the first 5 even numbers are:
22
Square of 2 = 4
Square of 4 = 16
Square of 6 = 36
Square of 8 = 64
Square of 10 = 100
Program 9: Display the cube of natural
numbers of user’s choice
Source Code
Import java.util.Scanner;
Public class CubeOfNaturalNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of natural
numbers to display their cubes: “);
Int n = sc.nextInt();
System.out.println(“Cubes of the first “ + n + “
natural numbers are:”);
23
For (int i = 1; i <= n; i++) {
System.out.println(“Cube of “ + i + “ = “ + (i * i
* i));
}
}
}
Working of the Program
1. The program takes the number of natural numbers
the user wants to process.
2. It calculates the cube of each natural number using
i * i * i in a loop.
Output
Enter the number of natural numbers to display their
cubes: 5
Cubes of the first 5 natural numbers are:
Cube of 1 = 1
Cube of 2 = 8
Cube of 3 = 27
24
Cube of 4 = 64
Cube of 5 = 125
Program 10: Display the cube of odd
numbers of user’s choice
Source Code
Import java.util.Scanner;
Public class CubeOfOddNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of odd
numbers to display their cubes: “);
Int n = sc.nextInt();
System.out.println(“Cubes of the first “ + n + “ odd
numbers are:”);
For (int i = 1, count = 0; count < n; i += 2, count+
+) {
System.out.println(“Cube of “ + i + “ = “ + (i * i
* i));
25
}
}
}
Working of the Program
1. The program asks the user how many odd numbers
to process.
2. It starts from 1 and increments by 2 to generate
odd numbers, calculating the cube of each using i *
i * i.
Output
Enter the number of odd numbers to display their cubes:
5
Cubes of the first 5 odd numbers are:
Cube of 1 = 1
Cube of 3 = 27
Cube of 5 = 125
Cube of 7 = 343
Cube of 9 = 729
26
Program 11: Display the cube of even
numbers of user’s choice
Source Code
Import java.util.Scanner;
Public class CubeOfEvenNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of even
numbers to display their cubes: “);
Int n = sc.nextInt();
System.out.println(“Cubes of the first “ + n + “
even numbers are:”);
For (int i = 2, count = 0; count < n; i += 2, count+
+) {
System.out.println(“Cube of “ + i + “ = “ + (i * i
* i));
}
}
}
27
Working of the Program
1. The user specifies how many even numbers they
want to calculate cubes for.
2. The program starts at 2 (the smallest even number)
and iterates through even numbers by incrementing
by 2.
3. Each even number is cubed using the formula i * i *
i and displayed until the count is met.
Output
Enter the number of even numbers to display their
cubes: 5
Cubes of the first 5 even numbers are:
Cube of 2 = 8
Cube of 4 = 64
Cube of 6 = 216
Cube of 8 = 512
28
Cube of 10 = 1000
Program 12: Display whether the number is
an Armstrong number
Source Code
Import java.util.Scanner;
Public class ArmstrongNumber {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter a number: “);
Int num = sc.nextInt();
Int originalNum = num, sum = 0;
While (num > 0) {
Int digit = num % 10;
Sum += digit * digit * digit;
Num /= 10;
}
29
If (sum == originalNum) {
System.out.println(originalNum + “ is an
Armstrong number.”);
} else {
System.out.println(originalNum + “ is not an
Armstrong number.”);
}
}
}
Working of the Program
1. The program takes an integer input from the user.
2. It calculates the sum of the cubes of its digits.
3. If the sum equals the original number, it is an
Armstrong number; otherwise, it is not.
Output
30
Enter a number: 153
153 is an Armstrong number.
Program 13: Display the sum of the series
of odd numbers of user’s choice
Source Code
Import java.util.Scanner;
Public class SumOfOddNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of odd
numbers to sum: “);
Int n = sc.nextInt();
Int sum = 0;
For (int i = 1, count = 0; count < n; i += 2, count+
+) {
Sum += i;
31
}
System.out.println(“The sum of the first “ + n + “
odd numbers is: “ + sum);
}
}
Working of the Program
1. The program generates odd numbers starting from
1 and sums them up until the required count is
reached.
2. The sum is displayed after the loop completes.
Output
Enter the number of odd numbers to sum: 5
The sum of the first 5 odd numbers is: 25
32
Program 14: Display the sum of the series
of even numbers of user’s choice
Source Code
Import java.util.Scanner;
Public class SumOfEvenNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of even
numbers to sum: “);
Int n = sc.nextInt();
Int sum = 0;
For (int i = 2, count = 0; count < n; i += 2, count+
+) {
Sum += i;
}
System.out.println(“The sum of the first “ + n + “
even numbers is: “ + sum);
}
}
33
Working of the Program
1. The program generates even numbers starting from
2 and sums them up until the count is reached.
2. The total sum is displayed.
Output
Enter the number of even numbers to sum: 5
The sum of the first 5 even numbers is: 30
Program 15: Display the product of the
series of odd numbers of user’s choice
Source Code
Import java.util.Scanner;
34
Public class ProductOfOddNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of odd
numbers to multiply: “);
Int n = sc.nextInt();
Int product = 1;
For (int i = 1, count = 0; count < n; i += 2, count+
+) {
Product *= i;
}
System.out.println(“The product of the first “ + n +
“ odd numbers is: “ + product);
}
}
Working of the Program
1. The program generates odd numbers starting from
1 and multiplies them.
2. The product is displayed after the loop completes.
35
Output
Enter the number of odd numbers to multiply: 3
The product of the first 3 odd numbers is: 15
Program 16: Display the product of the
series of even numbers of user’s choice
Source Code
Import java.util.Scanner;
Public class ProductOfEvenNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the number of even
numbers to multiply: “);
Int n = sc.nextInt();
Int product = 1;
36
For (int i = 2, count = 0; count < n; i += 2, count+
+) {
Product *= i;
}
System.out.println(“The product of the first “ + n +
“ even numbers is: “ + product);
}
}
Working of the Program
1. The program calculates the product of even
numbers starting from 2 up to the required count.
2. The final product is displayed.
Output
Enter the number of even numbers to multiply: 3
The product of the first 3 even numbers is: 48
37
Program 17: Display the series –
11111
22222
33333
44444
55555
Source Code
Public class SeriesNumbers {
Public static void main(String[] args) {
For (int i = 1; i <= 5; i++) {
For (int j = 1; j <= 5; j++) {
System.out.print(i);
}
System.out.println();
}
}
38
}
Working of the Program
1. The outer loop iterates from 1 to 5, representing
the row numbers.
2. The inner loop prints the same number 5 times in
each row.
3. After printing each row, a new line is added.
Output
11111
22222
33333
44444
55555
39
Program18: Display the series –
*
**
***
****
*****
Source Code
Public class StarPattern {
Public static void main(String[] args) {
For (int i = 1; i <= 5; i++) {
For (int j = 1; j <= i; j++) {
System.out.print(“*”);
}
System.out.println();
}
}
}
Working of the Program
40
1. The outer loop controls the number of rows (from 1
to 5).
2. The inner loop prints * as many times as the current
row number.
3. After printing each row, a new line is added.
Output
**
***
****
*****
41
Program 19: Input any numbers and display
the greatest common divisor (GCD)
Source Code
Import java.util.Scanner;
Public class GCDOfNumbers {
Public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(“Enter the first number: “);
Int num1 = sc.nextInt();
System.out.print(“Enter the second number: “);
Int num2 = sc.nextInt();
Int gcd = 1;
For (int i = 1; i <= Math.min(num1, num2); i++) {
If (num1 % i == 0 && num2 % i == 0) {
Gcd = i;
}
}
42
System.out.println(“The GCD of “ + num1 + “ and “
+ num2 + “ is: “ + gcd);
}
}
Working of the Program
1. The program takes two numbers as input.
2. It iterates from 1 to the smaller of the two numbers
to check for common divisors.
3. The largest divisor common to both numbers is
stored and displayed as the GCD.
Output
Enter the first number: 36
Enter the second number: 60
The GCD of 36 and 60 is: 12
43
Program 20: Display all the Buzz Numbers
between p and q (where p < q)
Source Code
Import java.util.Scanner;
public class BuzzNumbers {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the starting number (p): ");
int p = sc.nextInt();
System.out.print("Enter the ending number (q): ");
int q = sc.nextInt();
System.out.println("Buzz Numbers between " + p +
" and " + q + " are:");
for (int i = p; i <= q; i++) {
if (i % 7 == 0 || i % 10 == 7) {
System.out.println(i);
}
44
}
}
}
Working of the Program
1. The program takes two integers, p and q, as input.
2. It iterates through all numbers in the range [p, q].
3. A number is considered a Buzz Number if it is
divisible by 7 or ends in 7.
4. All Buzz Numbers in the range are displayed.
Output
Enter the starting number (p): 10
Enter the ending number (q): 50
Buzz Numbers between 10 and 50 are:
45
14
17
21
27
28
35
42
47
49
46
47
CONCLUSION
In conclusion, the Java program efficiently calculates and
displays various computational tasks, including prime numbers,
factorials, and discounts for different product categories. It
demonstrates effective use of control structures, input
handling, and mathematical computations, showcasing Java's
versatility and utility in practical programming scenarios.
This is all the information I wanted to provide through this
project. This project is really informative and I hope that my
work may help the reader to understand and get knowledge
about Java programming.
With Regards
Karanveer Singh
48
BIBLIOGRAPHY
The sources I have used to do this project :-
Chat GPT
ICSE UNDERSTANDING COMPUTER APPLICATIONS CLASS
9
JAVA ESSENTIALS FOR ICSE CLASS X
S’CHANDS ICSE COMPUTER APPLICATIONS
49
Thank you
50