0% found this document useful (0 votes)
2 views28 pages

Class 10 Project File

Hehehehe na na na na na na na na na na na na na na na na na

Uploaded by

17moinulhasan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views28 pages

Class 10 Project File

Hehehehe na na na na na na na na na na na na na na na na na

Uploaded by

17moinulhasan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Acknowledgement

I would like to extend my sincere and heartful thanks


towards all those who have helped me in making this
wonderful project. Without their active guidance, I
would not have been able to present the project on time.

I extend my sincere gratitude to


my principal Sr. Jossey Joseph and my Computer
teacher Mr. Mukund Singh, for their moral support and
guidance during the time of my project.

I also acknowledge my sincere


gratitude to my parents for their valuable suggestion
given to me in completing the project.
Ch-1:- Revision of Class IX
Syllabus
Unit-VI:- Mathematical Library Methods
Program:-1 Write a program in java to input three
numbers and display the greatest number.
Hint:- Use [Link]();

The output is:-


Program:-2 Write a program in java to calculate the
diagonal of a cuboid taking length, breadth and height
as input.
Hint:- diagonal= √l2+b2+h2

The output is:-


Unit-VII:-Conditional Statements In Java
Program-1:- Write a program to input three different
digit numbers between 1 and 9 (both inclusive). Display
the greatest and smallest three digit number.
Sample input:- 2,7, 4
Sample output:-
Greatest three digit number:- 742
Smallest three digit number:- 247
The output is:-
Program-2:- Write a menu program to find the area of
an Equilateral Triangle, an Isosceles Triangle and a
Scalene Triangle as per the user’s choice.
1. Equilateral Triangle= √3/4s2.
2. Isosceles Triangle= 1/4b*√4a2-b2.
3. Scalene Triangle= √s(s-m)(s-n)(s-p),s=m+n+p/2.
The output is:-
Unit-VIII:-Iterative Constructs In Java
Program-1:-Write a program in Java to enter a three
digit number and check whether the number is an
Armstrong number or not.
(A three digit number is said to be an Armstrong
Number if the sum of the cubes of its digits is equal to
the original number).
Sample Input:- 153
Sample Output:- 153 is an Armstrong Number because
13 + 53 + 33=153

The output is:-


Program-2:-An Automorphic Number is the number
which is contained in the last digit(s) of its square. Write
a program to input a number and check whether the
number is an Automorphic or not.
Sample Input:- 25
Solution:- The square of 25 is 625 and 25 is present as
the last two digits.
Sample Output:- 25 is an Automorphic Number.

The output is:-

Unit-IX:-Nested Loop
Program-1:-Write a program to find the sum of the
series:-
S=1+1/21+1/31+1/41+…………to 1/n!

The outpur is:-


Program-2:-Write a program to display all the prime
numbers between 1 and 100.
(Prime number is a number by 1 and the number itself
only.)

The output is:-


Chapter-2:-Library Class
Program-1:-Write a program in Java to accept a set of
any 10 characters. Calculate and print the sum of ASCII
codes of the characters.

The output is:-


Program-2:-Write a program in Java to input two
integer numbers. Join them together to form a single
number.
Sample Input:-
First Number is 134
Second Number is 96
Sample Output:-
Number after joining 13496

The output is:-


Chapter-3:-Arrays
Program-1:-Write a program to accept 20 different
numbers in a Single Dimensional Array (SDA). Display
the sum of all the numbers which are divisible by either
3 or 5.

The output is:-


Program-2:-Write a program to accept 10 different
numbers in a Single Dimensional Array (SDA). Arrange
the numbers in ascending order by using ‘Selection
Sort’ technique and display them.

The output is:-


Chapter-4:-String Handling
Program-1:-Write a program to display each letter of a
word entered by the user.
Sample Input:- BLUEJ
Sample Output:- B
L
U
E
J

The Output is:-


Program-2:-Write a program in Java to enter a String.
Print the String in alphabetical order of its letters.
Sample Input:- COMPUTER
Sample Output:- CEMOPRTU

The Output is:-


Chapter-5:-Defined Methods
Program-1:-Write a program to accept a number and
check whether the number is prime or not. Use the
function name as check (int n). The function returns 1,
if the number is prime otherwise, it returns 0.

The Output is:-


Program-2:-Write a program to accept a number and
check the number is palindrome or not by using the
method name reverse (int n). The method returns the
reversed number to the main program that checks the
palindrome number.

The Output is:-


Chapter-6:-Class as the Basis of all
Computation
(Objects and Classes)

Program-1:-Write a program using a class with main


function to operate two numbers.

The output is:-


Program-2:-Define a class Rectangle with the following
specification:
Class Name: Rectangle
Data members/Instance Variables:
int m: to input length of a rectangle
int n: to input breadth of a rectangle
Member Methods:
void inputdata(): to accept the length and breadth of the
rectangle
void calculate(): to find the areas, perimeter and
diagonal of the rectangle
void outputdata(): to display area, perimeter and
diagonal of the rectangle
The output is:-
Chapter-7:-Constructors
Program-1:-Write a program by using a class with the
following specifications:
Class name: Prime
Data members/Instance variables: int n
Member Methods:
Prime() : default constructor to initialize n
Void input(int x): to assign n with x
Void display(): to check whether the number is prime or
not
The main() method need not be written to perform the
above tasks.
The output is:-

Program-2:-Write a program by using a class with the


following specifications:
Class name: Profit_Loss
Data members/Instance variables: int cp, sp
Member Methods:
Profit_Loss(): default constructor to initialize cp,sp
Void input (int a, int b): to assign cp with m and sp with
n
Void display() : to calculate and display either profit
percent (pp) or loss percent (lp)
The main() method need not be written to perform the
above tasks.

The output is:-


Chapter-8:-Encapsulation and
Inheritance
Program-1:-Write a program by using a class name
Calculator with the following specifications:
Class name: Calculator
Data Members/Instance variables: private int result
Member Methods:
Calculator(): constructor to initialize result with zero
Void add(int a): to add a with the result
Void sum(int a): to subtract a form the result
Void mul(): to multiply a with the result
Void div(int a): to divide result by a
Void display(): to display result
Void clear(): to clear the result
The output is:-
Program-2:-“A number is said to be Palindrome, if it
appears to be the same after reversing its digits”. Write a
program by using a class with the following
specifications:

Thank You

You might also like