0% found this document useful (0 votes)
360 views7 pages

Computer Class 9 WS 1

For class 9

Uploaded by

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

Computer Class 9 WS 1

For class 9

Uploaded by

shlok patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Girls' High School and College,Prayagraj

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

Q1. ​OBJECTIVE QUESTIONS:

A.MULTIPLE CHOICE QUESTIONS :

1.Procedure Oriented Programming gives


importance to ……………
a)Instructions only
b)Instructions and data
c)Data only
d)None of these

2. Procedure Oriented Programming mainly uses……..


a)Top-down approach
b)Top-down and bottom up approach
c)Bottom up approach
d)None of these

3.Object Oriented Programming mainly uses………


a)Top-down approach
b)Top-down and bottom up approach

1/7
c)Bottom up approach
d)None of these

4.An object belonging to a particular class is known as a/an……… of that class.


a)Interface
b)Instance
c)Alias
d)Member

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

9.The ability of a function or object to take on multiple forms is called……..


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

B.STATE TRUE OR FALSE:

1.Low-Level languages are closer to computer hardware.


2.In Procedural language,code and data are held separately.
3.In Object Oriented Programming,code and data are held separately.
4.Wrapping up data and related functions in a single unit represents encapsulation.
5.The object is also known as an instance.
6.The class that is derived from another class is called a superclass.
7.Classes can be derived from other classes.
8.Inheritance allows a class to acquire the properties of another class.
9.A class is a blueprint for the attributes and behaviours of a group of objects.
10.Objects from the same class do not share the same definition of attributes and behaviours.

Q2.ANSWER THE FOLLOWING QUESTIONS:

1.What is Procedure Oriented Programming?

2.What is Object Oriented Programming?

3.What is an object? Give some examples.

4.What is a class? Give some real-life examples.

5.Name any two Object Oriented Programming principles.

6.Define Abstraction. Explain with an example.

7.What is Inheritance?

8.Define encapsulation.

9.What is Polymorphism?

10.What do you mean by a subclass and a superclass?

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#######

Chapter : Elementary Concepts of Objects and Classes

Q1. ​OBJECTIVE QUESTIONS:

A.MULTIPLE CHOICE QUESTIONS :

1.An object has …………


a)Attributes
b)State

4/7
c)Behaviour
d)All of these

2.A class is…………..


a)An object factory
b)A blueprint to create object
c)A specification for objects
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.The values of an object's……..represent the state of an object.


a)Methods
b)Procedures
c)Attributes
d) Classes

6.The term object and…………….. are often interchangeable.


a)Instance
b)Behaviour
c)Attribute
d)State

B.​STATE TRUE OR FALSE:

1.A Class is a specification about the object.


2.Only one instance can be created from a single class.
3.A class is a user-defined data type.
4.Real world objects encapsulate state and behaviour.
5.There can be multiple abstractions of the same entity.

5/7
6.Objects interact with each other through messages.

C.​IDENTIFY TWO POSSIBLE ATTRIBUTES AND TWO POSSIBLE BEHAVIOURS OF THE


FOLLOWING ENTITIES:

A. School
B. Student
C. Teacher
D. Computer
E. Television
F. Washing Machine
G. Chair
H. Person
.
Q2.​SUBJECTIVE QUESTIONS

A.​ANSWER THE FOLLOWING QUESTIONS IN SHORT:

1.Why is an object called an instance of a class?

2.Why is a class called an object factory?

3.What is the difference between an object and a class?

4.Why is a class known as a composite data type?

5.Why is a class known as a user-defined data type?

6.How do objects encapsulate state and behaviour?

7.What does a class encapsulate?

8.How do objects communicate with each other?

9.Explain the following statement--" Class is a specification for objects ".

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);
}
}

2.Create a program that will calculate the average (Km/L)of a car.

public class Average


{
public static void main (String args[])
{
float avg;
float distance=780.6f;
float fuel=52.3f;
avg=distance/fuel;
System.out.println ("distance travelled "+distance);
System.out.println ("fuel used"+fuel);
System.out.println ("average of your vehicle "+avg+"km/litre ");
}
}
####END####

7/7

You might also like