Class 10 Project
Class 10 Project
Materials /Resources Required: Computer with BlueJ installed, A4 Sheets ruled and
plain sheets for output.
Instructions /Guidelines :
1. Presentation must be upto the mark and impressive as assignment is an essential part of
internal assessment by ICSE board.
2. For reference a sample programs are being attached with.
3. First page will be the cover page. Write your name, class, section, subject, and to
whom it is to be submitted.
4. Acknowledgement
5. Index
6. Topic of the project
7. Content- For each program, arrange sheets having:
a. Problem Statement
b. Coding
c. Input / Output screen.
8. Conclusion
9. Bibliography / References
10. Each Page must have a specified page number.
11. Presentation must be upto the mark and impressive as project is an essential part of
internal assessment by ICSE board.
a) Introduction of Java.
b) Features of Java.
c) History of Java.
d) List of programs covering various levels of difficulty as per the syllabus.
(Complete any 15 programs from the given list.)
1. Write a program in Java to accept a number and Display Fibonacci series up to a
given number.
2. To print the Floyd’s triangle.
3. To display diamond of stars(*) based on value of n.
4. Program to make a simple calculator.
5. Write a program to store 20 numbers (even and odd numbers) in a Single
Dimensional Array (SDA). Calculate and display the sum of all even numbers and
all odd numbers separately.
6. Write a program to create an object and invoke student name , marks obtained in
subjects, total of marks, average of marks.
7. Define a class Bill that calculates the telephone bill of a consumer having name ,
number of calls, total bill.
8. Write a program to check whether the number is prime or not prime.
9. Program to display Sandglass Star Pattern.
10. Write a program to input two strings. Check both the strings and remove all
common characters from both the strings. Print both the strings after removing the
common characters.
11. Write a Java program to demonstrate method overloading by creating two sum
methods—one that adds two integers and another that adds three integers. Create
an object of the class and call both methods to display the sum of the numbers.
12. Write a Java program to demonstrate method overloading by creating two sub
methods—one that subtracts two integers and another that subtracts two double
values. Call both methods using an object and display the results of the
subtractions.
13. Write a Java program using a switch statement to print the name of a month based
on the value of an integer variable month. If the number is not between 1 and 12,
display "not valid". For example, if month = 7, the output should be "july".
14. Write a Java program to print all the elements of an integer array using a do-while
loop. The array is initialized with the values {2, 11, 45, 9}.
15. Write a Java program to check whether a number is even or odd using a separate
method. The number should be input by the user. Use a method named owo(int
num) to determine and print whether the number is even or odd.
16. Write a Java program to print sum of first 10 natural number.
17. Write a Java program to print reverse of any given number.
18. Write a program in Java to print
20. Write a Java program to print all the elements of an integer array using a do-while
loop. The array is initialized with any 10 values.
1. Write a program in Java to accept a number and Display Fibonacci series up
to a given number
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181,
6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, …
class Fibonacci {
public static void main(String[] args) {
while (firstTerm<= n) {
System.out.print(firstTerm + ", ");
}
}
}
2
2. To print the Floyd’s triangle [Given below]
1
23
456
7 8 9 10
11 12 13 14 15
/ Java program to display Floyd's triangle
// Importing Java libraries
importjava.util.*;
class GFG {
3
3. To display diamond of stars(*) based on value of n. For example if n=7 then
print,
importjava.util.Scanner;
intnoOfRows = sc.nextInt();
intmidRow = (noOfRows)/2;
int row = 1;
System.out.println();
row++;
}
4
//Printing lower half of the diamond
System.out.println();
row--;
}
}
}
Output :
5
4. Program to make a calculator using switch case in Java
importjava.util.Scanner;
public class JavaExample {
public static void main(String[] args) {
double num1, num2;
Scanner scanner = new Scanner(System.in);
System.out.print("Enter first number:");
scanner.close();
double output;
switch(operator)
{
case '+':
case '-':
output = num1 - num2;
break;
case '*':
output = num1 * num2;
break;
case '/':
output = num1 / num2;
break;
importjava.util.Scanner;
System.out.println("Enter 20 numbers");
for (int i = 0; i <arr.length; i++) {
arr[i] = in.nextInt();
}
intoddSum = 0, evenSum = 0;
Output
7
6. Define a class Student with the following specifications
Data Members Purpose
String name To store the name of the student
inteng To store marks in English
inthn To store marks in Hindi
intmts To store marks in Maths
double total To store total marks
doubleavg To store average marks
8
public static void main(String args[]) {
Student obj = new Student();
obj.accept();
obj.compute();
obj.display();
}
}
Output
9
7. Define a class Bill that calculates the telephone bill of a consumer with the
following description:
Data Members Purpose
intbno bill number
String name name of consumer
int call no. of calls consumed in a month
doubleamt bill amount to be paid by the person
public Bill() {
bno = 0;
name = "";
call = 0;
amt = 0.0;
}
10
else if (call <= 200)
charge = 60 + ((call - 100) * 0.8);
else if (call <= 300)
charge = 60 + 80 + ((call - 200) * 1.2);
else
charge = 60 + 80 + 120 + ((call - 300) * 1.5);
Output
11
8. Write a program by using a class with the following specifications:
Class name — Prime
Data members — private int n
Member functions:
Use a main function to create an object and call member methods of the class.
importjava.util.Scanner;
if (isPrime)
System.out.println("Prime Number");
else
System.out.println("Not a Prime Number");
}
12
9. Write a program to input two strings. Check both the strings and remove all
common characters from both the strings. Print both the strings after
removing the common characters.
13
10. Write a program to print Sandglass Star Pattern
importjava.util.Scanner;
public class Edureka
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number of rows: ");
Output
Enter the number of rows: 5
*****
****
***
**
*
*
**
***
****
*****
14
11.
15
;
12.
14
13.
15
14.
14
15,
15
16.
14
17.
15
18.
14
19
15
14
15