Skip to main content

ads1

Class 12th Ch-6 Object Oriented Concept (GSEB)

 Ch-6 Object Oriented Concept (GSEB)  

Object-oriented programming concepts started originating in the 1960s.It was developed as a way to handle the rapidly increasing size and complexity of software systems and to make it easier to modify these large and complex systems over time. Some of the popular programming languages that support object-oriented programming are CH, Java, C#, VB.net, AÅžP.net and PHP.

In object-oriented programming, attributes that describe the object are also referred to as data fields.The data attributes and behavioral methods associated with an object are collectively referred to as its members or features.

Class :- Object-oriented system uses the concept of class that enables to express the set of objects that are abstractly equivalent, differing only in the values of their attributes. Class can be considered as a blueprint for various objects.

Encapsulation :-This mechanism of providing protection to data and methods of a program is called encapsulation.  Encapsulation keeps the data safe from unintended actions and inadvertent access by outside objects. object-oriented programming discourages direct access to common data.

Data Abstraction :- Data abstraction is a process of representing the essential features of the objects without including implementation detail. Abstraction is a concept that bides the complexity; it says what it does, but not how it is done.

Polymorphism :-  Polymorphism means 'many forms'. There may be different forms of single method or operation.
Object-oriented programming allows defining more than one method having same name but different signatures in a single class. This feature is known as function or method overloading.
 This type of polymorphism is achieved through operator overloading. Thus, polymorphism is achieved using two types of overloading: function overloading and operator overloading. In general, the capability of using same names to mean different things in different contexts is called overloading. Aggregation and Composition

Inheritance :- Inheritance is generally referred to as 'is-a-kind-of relationship between two classes. It is appropriate when one class is 'a kind of other class. For example, teacher is a kind of person.

Inheritance refers to the capability of defining a new class of objects that inherits the characteristics of another existing class. In object-oriented terminology, new class is called sub class or child class or derived class; whereas the existing class is called super class or parent class or base class.

(1) In Object-oriented methodology, the focus is on which of the following entities?

(a) Data   (b) Functions    (c) Objects   (d) All of the above
 
(2) Which of the following best suits to Java ?

(a) A procedural programming language
(b) An Object-oriented programming language
(c) A Query language
(d) All of the above

(3) Which of the following is used to distinguish objects from each other ?
(a) Attributes    (b) State   (c) Behavior    (d) All of the above

(4) Which of the following is used to define common features of similar objects ?
(a) Class      (b) Object   (c) Methods   (d) All of the above

(5) Which of the following is not a visibility symbol ?
(a)`
(b) *
(c) #
(d) - O

(6)Which of the following is provided using encapsulation ?

(a) Data protection
(b) Data sharing
(c) Separation of data and methods
(d) All of these

(7)Which of the following is enabled by data abstraction ?

(a) Data protection
(b) Data hiding
(c) To hide implementation details of method manipulating the data
(d) All of these

(8) With which of the following options polymorphism cannot be achieved ?

(a) Method overloading  (b) Operator overloading   (c) Data hiding   (d) All of these

(9) An aggregation model refers to which of the following relationships ?

(a) 'is-a' relationship    (b) 'is-like' relationship   (c) 'a-part-of relationship    (d) All of these

(10) An inheritance model refers to which of the following relationships ?

(a) 'is-a' relationship
(b) has-a' relationship
(c) 'a-part-of relationship
(d) All of these

(11) In class diagram, composition is represented using which of the following symbols ?
 

(a) Empty diamond symbol    

(b)Filled diamond symbol   

(c) Empty triangle symbol   

(d) All of these 

 

Link to download MCQ




ads2

Popular posts from this blog

11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following:

    11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following: Basic Salary <= 10000 : HRA = 20%, DA = 80% Basic Salary <= 20000 : HRA = 25%, DA = 90% Basic Salary > 20000 : HRA = 30%, DA = 95% Static Solution :-  class salary {     public static void main(String args[])     {     double basic=20000.50,gross,da,hra;     if(basic <=10000)     {         da = basic * 0.8;         hra = basic *0.2;     }              else if(basic <=20000)     {         da = basic * 0.9;         hra = basic *0.25;     }     else     {         da = basic * 0.95;         hra = basic * 0.3;     }     gross = basic + da + hra;     System.out.println("The Gross Salary is :-"+gross);     } } Output :-  Dynamic Solution :-  class salary {     public static void main(String args[])     {     double basic=20000.50,gross,da,hra;     Scanner in = new Scanner(System.in);     System.out.println("Enter the Basic Salary

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise or class wise.

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise  or class wise. Solution :-   # x-axis is shows the subject and y -axis # shows the markers in each subject # import pandas and matplotlib  import pandas as pd  import matplotlib.pyplot as plt # Simple Line Chart with setting of Label of X and Y axis, # title for chart line and color of line  subject = ['Physic','Chemistry','Mathematics', 'Biology','Computer'] marks =[80,75,70,78,82] # To draw line in red colour plt.plot(subject,marks,'r',marker ='*')     # To Write Title of the Line Chart plt.title('Marks Scored') # To Put Label At Y Axis plt.xlabel('SUBJECT')           # To Put Label At X Axis plt.ylabel('MARKS')             plt.show() Output :- 

24.Create a Data Frame quarterly sales where each row contains the item category, item name, and expenditure. Group the rows by the category and print the total expenditure per category.

24.Create a Data Frame quarterly sales where each row contains the item category, item name, and expenditure. Group the rows by the category and print the total expenditure per category. import pandas as pd  # initialize list of lists data = [['CAR','Maruti',1000000],['AC','Hitachi',55000],['AIRCOLLER','Bajaj',12000], ['WASHING MACHINE','LG',15000],['CAR','Ford',7000000],['AC','SAMSUNG',45000],['AIRCOLLER','Symphony',20000],['WASHING MACHINE','Wirlpool',25000]] Col=['itemcat','itemname','expenditure'] # Create the pandas DataFrame qrtsales = pd.DataFrame(data,columns=Col) # print dataframe.  print (qrtsales) qs=qrtsales.groupby('itemcat')  print('Result after Filtering Dataframe')  print(qs['itemcat','expenditure'].sum()) Output :-