Computer Class 9 WS 1
Computer Class 9 WS 1
Worksheet No.--1
Session:2020-2021
Class : 9th Section : C,D,E
Subject:Computer Applications
Chapter : Introduction to Object-
-Oriented Programming Concepts
Instruction : Parents are expected to ensure that the student spends two days to read and
understand the chapter according to the books and website referred and thereafter answer the
given questions.
Reference books:
1.Logix class 9th (Kips Publications)
2.Sumita Arora class 9th (Dhanpat Rai & Co.)
Link: https://youtu.be/esflI8fDlRo
Link: https://youtu.be/jzz_hy4M8zo
1/7
c)Bottom up approach
d)None of these
5.Objects that share the same attributes and behaviour are grouped together into a/an….
a)Interface
b)Instance
c)Alias
d)Class
6……. is the technique of binding both data and functions together to keep them safe from
unauthorised access and misuse.
a)Abstraction
b)Inheritance
c)Encapsulation
d)Polymorphism
7……… refers to the act of representing essential features without including the background
details.
a)Abstraction
b)Inheritance
c) Polymorphism
d) Encapsulation
8…… is the feature by means of which one class acquires the properties of another class.
a)Abstraction
b) Inheritance
c)Encapsulation
d) Polymorphism
2/7
10.The term OOP stands for……
a)Object Oriented Procedure
b)Object Oriented Packet
c)Object Oriented Programming
d)Object Orientation Procedure
7.What is Inheritance?
8.Define encapsulation.
9.What is Polymorphism?
3/7
11.State the Java concept that is implemented through:
i)A superclass and a subclass.
ii)The act of representing essential features without including background details.
12.Write two major differences between Procedure Oriented Programming and Object Oriented
Programming.
Q3. PROGRAM :
Execute the given program on Bluej and check whether entered number is a perfect number or
not .
[Perfect number is a number which is equal to the sum of it's factors, leaving the number itself .
Example 6=1+2+3, ( hence 6 is a perfect number .)]
class Perfect
{
public static void main (int n)
{
int sum=0;
for (int j=1;j<n;j++)
{
if(n%j==0)
sum=sum+j;
}
if(sum==n)
System.out.print("It is perfect number ");
else
System.out.print ("It is not a perfect number ");
}
#######END#######
4/7
c)Behaviour
d)All of these
3………. represents an entity in the real- world with its identity and behaviour .
a)A class
b) An object
c)A procedure
d)A function
4………. is the template to create similar objects that share common characteristics and
behaviour.
a)A function
b)A procedure
c)An attribute
d)A class
5/7
6.Objects interact with each other through messages.
A. School
B. Student
C. Teacher
D. Computer
E. Television
F. Washing Machine
G. Chair
H. Person
.
Q2.SUBJECTIVE QUESTIONS
10.Explain the following statement--" Abstraction is relative to the perspective of the viewer ".
B.PROGRAMS:
1. Create a program that will store the height and radius of a cone in two separate variables
. Calculate the volume and display the result.
6/7
public class Volume_of_cone
{
public static void main(String args [ ])
{
double radius,height,volume;
double PI=3.14;
radius =20.5;
height =40.5;
volume =((PI*radius *radius *height) * ⅓ );
System.out.println("radius of cone"+radius );
System.out.println("height of cone"+height);
System.out.println("volume of cone"+volume);
}
}
7/7