You are on page 1of 4

Don Bosco School, Liluah

Class 9: Computer – Project (Second Term 2022- 2023)

Part - 1
With the help of short code fragments explain the working of the following
mathematical functions: [ any 6 ]
a) toRadians( )
b) toDegrees( )
c) tan( )
d) cos( )
e) sin( )
f) rint( )
g) round( )
Display the output after executing the code.

Part - 2
Program – 1
An n digit number is Narcissistic if the sum of its digits to the nth power equal the
original number.
For example with 2 digits, say we choose the number 36:
32 + 62 = 45. Therefore 36 is not a narcissistic number, as our answer is not 36.
For example with 3 digits, say we choose the number 124:
13 + 23 + 43 = 73. Therefore 124 is not a narcissistic number as my answer is not
124.
Write a program to accept any two numbers(x and y) and display the Narcissistic
numbers within the range (x,y) and also display a count of number of Narcissistic
numbers.

Program – 2
Tech Number
A number is called a tech number if the given number has an even number of
digits and the number can be divided exactly into two parts from the middle. After
equally dividing the number, sum up the numbers and find the square of the sum.
If we get the number itself as square, the given number is a tech number, else, not
a tech number. For example, 3025 is a tech number.

Tech Number Example


Let's take an example and check 2025 and 1312 are tech numbers or not.
Write a java program to accept any number and check whether the number is
Tech number or not.

Program – 3
Xylem and Phloem Number
A number N will be a xylem number if the sum of its extreme (first and last) digits
is equal to the sum of mean (all digits except first and last) digits. If the sum of
extreme digits is not equal to the sum of mean digits, the number is called phloem
number.

Write a java program to check whether a number is Xylem or Phloem Number or


not.
Program - 4
Write a complete java program to print the pattern given below (using loops):
@@@@@@
@ # # # # @
@ ## # # @
@ ## # # @
@ ## # # @
@ ## # # @
@@@@@@

Program - 5
Write a complete java program to print the pattern given below(using loops):
@ @ @ @@
& & & & &
& & & & &
& & & & &
@ @ @ @@

Program 6
Define a class having the following overloaded functions:
public void findArea(int s) – finds and displays the area of a square of side ‘s’.
public void findArea(float len, float brd) – finds and displays the area of a rectangle
of length ‘len’ and breadth ‘brd’.
public float findArea(float base, float height) – finds and displays the area of a
triangle having base ‘bs’ and height ‘ht’.
public float findArea(float rad) – finds and displays the area of a circle having
radius ‘rad’.

Program 7
Define a class having the following overloaded functions:
public void display(int n) - displays the following pattern, if n=5
@
@@
@@@
@@@@
@@@@@

public void display(int m,int n) – displays the following pattern, if m=4 and n=5
&&& &&
&&& &&
&&& &&
&&& &&

public void display(int n, char ch) – displays the following pattern, if m=4, ch= ‘&’
&&&&
&&&
&&
&
Instructions:
1. Use Laboratory file papers to do your project.
2. All your project file must be very well covered by brown papers with your
name, class, section, Subject, Project topics, etc written on the top.
3. Do not use unnecessary decorations.
4. For every program you need to show/paste the output screenshot and write
the Variable Glossary/ Variable Definition Table.
5. Your project must have an Introduction, acknowledgement or bibliography
and program source with output screenshot is needed to be done in the
project.
6. Date of Submission : 5 Jan., 2023

You might also like