Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Al Ameen Pre University College, Bangalore

Subject: Computer Science

Chapter 1 : TYPICAL CONFIGURATION OF COMPUTER SYSTEM


1. Define Microprocessor.
Ans. Microprocessor is an IC which has the capability to process the given data based on the instructions.

2. What is Motherboard?
Ans.. Motherboard is a main PCB which connects different components in a computer system.

3. Which is the fastest memory in a computer?


Ans. Cache memory is the fastest memory in a computer.

4. What is a port?
Ans. It is a connector used external device to a computer
5. How many bits of data are sent in a serial port?
Ans. 1-bitof data at a time

6. Expand
a. PCB- Printed Circuit Board
b. ISA- Industrial Standard Architecture
c. DDRRAM- Double Data Rate Random Access Memory
d. SDRAM-Synchronous Dynamic Random Access Memory
e. PCI-Peripheral Component Interconnect
f. AGP-Accelerated Graphics Port
g. USB-Universal Serial Bus
h. SMPS-Switch Mode Power Supply
i. UPS- Uninterrupted power supply
j. CMOS-Complementary Metal Oxide Semiconductor

7. Name any one USB device.


Ans . Pen Derive

8. Define Bus /System bus, Address bus and control bus.


Ans . Bus/System Bus :- is a set of wires which connects CPU to memory & other devices.
Address Bus. which carries the memory address or peripheral address from the CPU. Address Bus is Uni-
directional.
Data Bus. Which carries data signals between different components of a computer system. Data Bus is Bi-
directional.
Control Bus. Carries control singnals between different components of acomputer system. Control Bus is Bi-
directional.
Define chipset.
Ans. It is a set of controllers that looks after data transfer among different components in a computer
system.
9. What is Cache Memory?
Ans. Cache memory is high speed memory, placed in between CPU and RAM.
Al Ameen Pre University College, Bangalore
Subject: Computer Science

10. Define Chipset.


Ans. It is a set of controllers that looks after data transfer among different components in a computer
system.

11. What is Plug and Play device?


Ans. A device which can be connected & used with minimum human intervention (or with minimum
installation procedure) in a computer system.

THREE Marks Questions.

12. Explain the different components of motherboard.


Ans. The different components of motherboard are:
Processor: the processor or the CPU is the main component on the motherboard. It consists oa ALU & CU
and a set of registers.CPU is fabricated as a single Integrated Circuit(IC) chip.
BIOS: it is a small chip on the motherboard that holds a set of instructions to load the hardware settings
required to activate various devices like keyboards, monitors or disk drives . It invokes the bootstrap loader
to load operating system into the memory.
CMOS: It is a type of memory chip to store the date , time and system setup parameters.
Expansion slot: these are openings where you can insert a print circuit board. These are used to add some
additional functionality to the system. The different types of slots are ISA,AGP ,PCI ,RAM , Slot etc.
Ports. The ports and interfaces are used to connect external devices like printer, keyboards or scanner to
the mother board. The different kinds of ports are serial port, parallel port USB Port AGP etc.
CPU SOCKET:- To install the microprocessor.
RAM Slot:- to install the RAM modules.
Chipset:-The controllers in the motherboard are combined mainly in two chips(ICs) called the north bridge
and south bridge. The chipset ICs i.e., north bridge and south bridge are used to manage the data traffic on
the motherboard.

13. Explain the characteristics of motherboard.


Ans. The main characteristics of a motherboard include.
(i) Form factor (ii) chipset (III)Processor Supported.
(I) Form Factor:-- the form factor determines the size and shape of the motherboard and also
determines what kind of cabinet or case it will fit into. Some of the form factors include XT-board,
AT board, Baby-At board , ATX etc.
(II) Chipset:-The controllers in the motherboard are combined mainly in two chips(ICs) called the north
bridge and south bridge. The chipset ICs i.e., north bridge and south bridge are used to manage the
data traffic on the motherboard.
(III) Processor Supported:-Different motherboards support different processors. Same motherboard
doesn’t support all the processors. So, motherboard selection mainly depends on the processor
used.
Al Ameen Pre University College, Bangalore
Subject: Computer Science

14. Write the feature of USB port.


Ans. (a). Devices connected to this port are Plug and Play devices
(b). USB devices can be connected to & disconnected from this port at any point of time during
system usage(it is a hot-pluggable port).
(c). 127 USB device can be connected to this port.
15. Explain the type of mother board.
Ans. Types of mother board are
I. XT motherboard
II. Full AT or AT motherboard
III. Baby AT motherboard
IV. ATX motherboard

XtT Motherboard:--- the XT( eXtended Technology ) motherboard was used in earlier time. It has the old
type socket for CPU i.e LIF(Low Insertion Force) socket. It also as DIMM RAM slots, ISA expansion slots and
12pins power connector.

Full AT or AT motherboard:--- the AT(Advanced Technology) motherboard was the first type of
motherboard used in PC’s .Its size was 12 inches wide and 11 inches long. The motherboard suffered from a
lot of problems, like cumbersome access to components and overheating.

Baby AT motherboard:--A smaller version of the original AT motherboard used in the IBM PC/AT.
Introduced in 1987, the baby AT reduced width from12” to *.%”.Although its maximum length was !#”,
most Board were only 9” or 10 “ long. The baby AT was the first PC motherboard to build these sockets for
I/O ports(serial and parallel), which were cabled to connectors on the back of the case. It was wildly used in
386,486 and early pentiumPCs. The Baby AT was superseded by the ATX motherboard . the DIN(DUECHE
Industrie Norm) is a keyboard connector at the top right corner of this motherboard, makes recognizing
this motherboard a relatively simple task.

ATX motherboard:---An ATX(Advanced Technology Extended motherboard)is a PC motherboard that


superseded the Baby AT design. The ATX layout rotated the CPU and memory 90 degrees. Allowing full-
length expansions to be plugged into all socket. the power supply blows air over the CPU rather than
pulling air through the chassis.

16. Explain types of power supply.


Ans. (a). SMPE converts electric power from AC(Alternating current) mains to different DC voltages
required by the different computer components in a computer system like Microprocessor, RAM, HDD,DVD
drive, etc.
(b).UPS generally protects a computer against different power problems like Power failure, power
fluctuation, Voltage surges and spikes.
There are mainly of two types of UPS system
I. Off-line UPS
II. On-line ups
I. Off-line UPS:---it draw power from the battery when ever mains power supply is not there.
II. On-line:---it always drawpower from the battery. On-line UPS is costlier thanoff-line UPS.
Al Ameen Pre University College, Bangalore
Subject: Computer Science

POINTER
1. Define a pointer.
Ans. Pointer is a variable that holds memory address of another variable.
2. How do you declare a pointer?
Ans. Syntax
Data-type *ptrvar;
E.g. int *p;
3. How do you initialize a pointer?
Ans. Pointer is initialized using address of (&) operator.
E.g. int *p,n;
P=&n;
4. What is static memory allocation?
Ans. Memory allocation done at compile time.

5. What is Dynamic memory allocation?


Ans. Memory allocation done at run time.
6. What is the purpose of new operator.
Ans. It is used for dynamic memory allocation.

7. What is the purpose of delete operator.


Ans. It is used for releasing the memory allocation.
8. What is free store?
Ans. An unallocated heap memory or free memory.

9. Mention any one advantage of pointer.


Ans. Efficient memory utilization.
10. What is the use of this pointer?
Ans. this pointer is used by an object to access the address of its own (object).
i.e., Every object in C++ has access to its own address through an important pointer called this pointer.
3-marks Question:
11. Explain the address of operator(&) and Indirection Operator(*) used with pointer.
The “address – of “ or “&” is a unary operator that returns the memory address of its operand.
E.g int num;
then “&num” gives its memory address.
The “Indirection “ or “*” Operator is a unary operator that returns the value of the variable located at the
address specified by its operand .
E.g int n =10;
Int *ptr;
ptr=&n;
cout<<” Address of N= “<<ptr; [using the statement &n we can also print the address]
cout<<”Value of N=”<<*ptr; [same as cout<<”value ofN=”<<n;]
Note : above two statements we are printing the value and address using pointer variables.
Al Ameen Pre University College, Bangalore
Subject: Computer Science

12. What are the advantages of using Pointers?


Ans. I) Pointer helps in writing efficient programs.
II) It helps in proper Memory utilization.
III) Complex data structure are implemented using pointer.
IV) It support dynamic memory allocation and de-allocation.
13. What are the operations supported by pointers?
Ans. Arithmetic operation like
i. Addition of a numeric value to a pointer
ii. Subtraction of a numeric value from a pointer ,
iii. Multiplication of a value to a pointer are allowed.
iv. Increment (++) operator.
v. Decrement (- -) operator.
Pointer cannot perform these
i. Addition of two pointers.
ii. Multiplication of two pointers.
iii. Division of two pointer and also
iv. We can compare two pointers, if they point to the element of the same array.
v. We can assign one pointer to another pointer provided both are of same type.
14. What is the difference between Static & Dynamic Memory Allocation.
Static Memory Allocation Dynamic Memory Allocation
Memory allocation is done at compile- time Memory allocation is done at run- time
Memory allocation or de-allocation is not allowed Memory allocation and de-allocation can be done
during program execution
Size of memory allocated during compile time Size of memory allocated can be changed during
cannot be changed program execution
E.g int n, a[12],x; Memory can be allocated or de allocated at run
time using new & delete operators.
Not an efficient method of memory allocation An efficient method of memory allocation
15. What is a new operator in C++?
Ans. A new operator is used for dynamic memory allocation
Syntax:
Pointer_variable = new
data_type;
E.g. ptr=new int;
In above example ptr is a pointer variable,
A new operator allocates 2 bytes of memory and assigns that to the variable ptr.
16. What is a delete operator in C++?
Ans . a delete operator is used for de-allocation purpose .
Syntax:
delete Pointer_variable ;
E.g. delete ptr;
Pointers and functions.
i. By passing the references.
ii. By passing the pointer.
Al Ameen Pre University College, Bangalore
Subject: Computer Science

i. Bypassing the references.


#include<iostream.h>
#include<conio.h>
Void main()
{
void swap(int & ,int &)
int a=10, b-20;
cout<<”Original Values : “;
cout<<”a= “<<a<<” b= “<<endl;
swap(a,b);
cout<<”values after swapping ”;
getch();
}

Void swap(int &x, int &y)

{ int temp;

Temp =x;

X= y;

Y= temp;

ii. By passing the pointer.


#include<iostream.h>
#include<conio.h>
Void main()
{
void swap(int & ,int &)
int a=10, b-20;
cout<<”Original Values : “;
cout<<”a= “<<a<<” b= “<<endl;
swap(a,b);
cout<<”values after swapping ”;
getch();
}
Void swap(int &x, int &y)
{ int temp;
Temp =x;
X= y;
Y= temp;
}
Al Ameen Pre University College, Bangalore
Subject: Computer Science

FILE HANDLING

1. Define astream. What are its type?


Ans. A stream is a sequence of characters that move from source to destination.
2. What are the different types of stream classes?(or Define fstream class).
Ans. i. ifstream:--used for read operation (which is derived from istream class)
ii. ofstream:--used for write operation (which is derived from ostream class).
iii fstream:--used for both read & write operation (which is derived from iostream class).
3. Differentiate between ifstream & ofstream classes.
OR
List some member functions belong to ifstream & ofstream class.
Ifstream Ofstream
This class support input operations This class support output operations
It contains open() with default input mode. It contains open() with default output mode.
Inherts the functions get(), getline() ,read(), Inherts the functions put(), write(), seekp() ,
seekg(),tellg() functions of istream. tellp() functions of ostream.

4. What are the method of opening a file?


Ans.A file can be opened in 2ways.
i. Using constructor of the class
ii. Using member function open()of the class.
e.g.: ofstream studfile;
studfile.open(“result.dat”);
5. What are the different types of files?
Ans.a. Text file:-- A file which contain data in ASCII(or text) format.
b. Binary file:-- A file which contain data in binary form.
6. What are the advantages of binary files and text file?
Advantages of Binary file
i. Data processing takes place faster.
ii. No need of translation
iii. Data is represented in binary form as main memory of the system stores.
iv. The binary files help to save memory space.
v. File I/Operation would be faster when compared to text files.
vi. The binary files are useful when we work with database..

Advantages of Text file

i. Better readability of contents.


ii. It has EOL(End Of Line) and EOF(End OfFile) characters asdelimiters.
iii. Thus certain internal translation take place.
Al Ameen Pre University College, Bangalore
Subject: Computer Science

7. Differentiate between get() and getline()functions.


get() getline()
This function reads a single character This function reads whole line of text or number of characters.
E.g filein.get(ch) E.g filein.getline(str,size)

8. Differentiate between read() and write()functions.


read() write()
This function is used to read blocks of binary data This function is used to write blocks of binary data
from a file. to a file.
This member function belongs to the class This member function belongs to the class
ifstream. ofstream.

9. What is the purpose of seekg() ,seekp(),tellg() and tellp() functions.


i. seekg():--This function is used to move the get pointer to a specified position.
ii. tellg():--This function is used return current position of the get pointer.
iii. seekp():--This function is used to move the put pointer to a specified position.
iv. tellp():--This function is used to return the current position of the put pointer.

3-marks questions

10. what are the various file opening modes?


Mode Meaning
ios::in Open the file in read only mode
ios::out Open for write only
ios::app Open in append mode
ios::ate go to end of file
ios::binary Open the file in binary mode

11. Explain the working of get(), getline(), put() functions.


Ans .
i. get() member function:-- belongs to the class ifstream and the function get() reads a single character
from the associated stream.
Syntax:
Ifstream_object.get(ch);
E.g. obj.get(ch);
ii. getline() member function:-- it is used to read a whole line of text till new line character is encountered
or number of characters mentioned. It belongs to the class ifstream.
Syntax:
fin.getline(buffer,SIZE);
E.g. fin.getline(buffer,SIZE);
iii. put() member function:-- belongs to the class ofstream and writes a single character to the associated
stream.
Syntax:
Ofstream_object.put(ch) ;
E.g. obj.put(ch);
Al Ameen Pre University College, Bangalore
Subject: Computer Science

LOGIC GATES
1. Define logic gate. What are its types?
Ans. A logic gate is a basic unit of digital circuit, which operates on one or more inputer gives single
output. Types of logic Gates are :
i. Basic gates
ii. Derived gates

2. What is another name for Boolean Algebra.


Ans. Switching Algebra
3. List the Basic gates.
Ans. AND, OR , NOT
4. List the Derived gates.
Ans. NOR, NAND, XOR, XNOR
5. Write the Logic symbol and truth table of NOT gate.
Ans.

X X X
0 1
1 0

6. Which gate is also called an Inverter?


Ans. NOT gate.
7. Define truth table.
Ans. truth table is a table which shows all the possible inputs and the corresponding output for those set
of inputs.
8. Write Logic symbol and truth table of AND gate.
Ans.
X Y X.Y
X 0 0 0
Y F=X.Y 0 1 0
1 0 0
1 1 1
9. Write Logic symbol and truth table of OR gate.
Ans.
X Y X+Y
X 0 0 0
Y F=X+Y 0 1 1
1 0 1
1 1 1
10. Define Universal gate.
Ans. Using only this gate all the other gates can be designed is called a universal gate.

11. List Universal gate.


Ans. NOR,NAND are the two Universal gates.
Al Ameen Pre University College, Bangalore
Subject: Computer Science

12. Write the Logic symbol and truth table of NOR gate.
Ans.

X X Y X+Y
Y X+Y 0 0 0
0 1 1
1 0 1
1 1 1
13. Write Logic symbol and truth table of NAND gate.

X Y X.Y
X X.Y 0 0 0
Y 0 1 0
1 0 0
1 1 1

14. Write the Logic symbol and truth table of XOR gate.
Ans.

X Y X ƟY
X 0 0 0
Y X+Y 0 1 1
1 0 1
1 1 0

15. Write the Logic symbol and truth table of XNOR gate.
Ans.

X X Y X ƟY
Y X+Y 0 0 1
0 1 0
1 0 0
1 1 1
Al Ameen Pre University College, Bangalore
Subject: Computer Science
16. Design the basic gates using NAND gates only.(Show that NAND gate is a universal gate.
Ans. all other can be designed using only NAND gates. It is depicted as:
i. Designing NOT gate from NAND.
Ans.

X X

ii. Designing AND gate using NAND gates only.

X X.Y
Y

iii. OR gate designing from NAND gates only.

X+Y

17. Designing the basic gates using NOR gates only. OR Design NOT,OR, AND gates using NOR gates
only. OR Realize the basic gates using only NOR gates.

Ans.

i. Designing NOT gate from NOR gate.

X X

ii. Realizing OR gate using NOR gates only.

X
X.Y X+Y
Y

iii. Designing AND gate using NOR gates only.

X .Y

Y
Al Ameen Pre University College, Bangalore
Subject: Computer Science

10 INHERITANCE
1. What is inheritance? Explain its type.
Ans. The process of creating a new class from already existing class is called Inheritance.
Types of inheritance

i. Single inheritance: In single inheritance there is a derived class created from single base class.
Class A

Class B

ii. Multilevel inheritance: In Multi level inheritance, a class inherits its properties from another
derived class Class A
.

Class B

Class C
iii. Multiple Inheritance :--In Multiple inheritance ,a derived class inherits from 2 or more base
classes. It inherits the properties

Class A Class C

Class D
iv. Hierarchical Inheritance:--Hierarchical inheritance is like an inverted tree. Here, multiple classes
inherit from a single base class.
Class A

Class B Class C Class D


v. Hybrid Inheritance:--It is a combination of other type of inheritance . it may be a combination of
two or more different kinds of inheritance .(like multi-level, multiple and/ or hierarchical
inheritance). Class A

Class B Class C

Class D
2. Define Base class and Derived class?
Ans. Base class: --It is class whose properties are inherited by another class. It is also called Super class
Derived Class:-- It is class that inherits properties from base class. It is also called Sub class
Class A Base class

Derived Class
Class B
Al Ameen Pre University College, Bangalore
Subject: Computer Science
3. What are the advantages of inheritance .
 Reusability of the existing code.
 Faster Program Development.
 Easy to Extend
 Easy to maintain
 Efficient Memory Utilization
 Debugging the program is easier (Since, we are inheriting the class already tested)

4. Explain Visibility mode.


Ans. Visibility mode tells how base class members are visible in the derived class.
Or Visibility mode tells which are all the base class members are accessible in the derived class. I t can be depicted
using table as show below:
Base class Derived class
Public Mode Private mode Protected mode
Public Public Private Protected
Protected Protected Private Private
Private Not inherited Not inherited Not inherited
Three types of access specifiers in C== are:
 private
 public
 protected
Private: In private members of a class can be accessed only by the member functions of that class i.e., private members
cannot be accessed outside the class. The default access specifier is private i.e., if access spacifier is not mentioned, the
member is private by default .outside the class through an object of that class.sso, the public members are accessible
within the class as well as outside the class.
Class son : private father //private derived class
{
private:
Char company[30];
Float salary;
public:
void getdata();
void display();
};

Protected: The protected members are similar to private members of a class if a single class exists. but, if a class is
derived from a base class, the protected members of a base class can be accessed in the derived class also. Or class
members declared as protected can be accessed by member functions and friends of the class.
Class son: public father //Derived class
{
private:
Char company[30];
Float salary;
public:
void retdata();
void displaydata();
};
Al Ameen Pre University College, Bangalore
Subject: Computer Science

Public: In public members of a class can be accessed outside the class through an object of that class.sso, the
public members are accessible within the class as well as outside the class.
Class father //Base class
{
private:
Char name[30];
int age;
public:
Char caste[30];
int boys;
int girls;
void readdata();
void printdata();
};
Class son: public father //Derived class
{
private:
Char company[30];
Float salary;
public:
void retdata();
void displaydata();
};
5. virtual base class:--- when two or more objects are derived from a common base class, we can prevent
multiple copies of the base class being present in an object derived from those object by declaring the base
class as virtual when it is being inherited. Such a base class is know n as virtual base class.
6. Abstract classes:---the class which is designed only for base class purpose and it is not used for creating the
objects is called abstract class.
7. Explain single inheritance with an example.
i. Single inheritance: In single inheritance there is a derived class created from single base class.
Class A Student

Class B Result

The derived class apart from having its own data members and member function, can inherit some
or all the public or protected members of the base class.
Example:
Class student
{
private: int rollno;
public: void baseinput()

{ cout<<”\n Enter the roll number”;

cin>>rollno;

}
Al Ameen Pre University College, Bangalore
Subject: Computer Science
void basedisplay()

cout<<”\n Roll Number”<<rollno;

};

class result : public student //Derived class

private: int mark1,mark2,total;


public:
void derinput()
{

cout<<”\n Enter the first & second subject marks : “;

cin>>mark1;

cin>>mark2;

void derdisplay()

Total=mark1+mark2;

cout<<”\n Subject 1 Marks = ”<<mark1;

cout<<”\n Subject 1 Mark2 = ”<<mark1;

cout<<”\n Total Marks = ”<<total; }

};

void main( )

result X;

clrscr();

X.baseinput()
X.basedisplay()
X.derinput()
X.derdisplay()
getch()
}
Al Ameen Pre University College, Bangalore
Subject: Computer Science

BOOLEAN ALGEBRA

Simplify using K- map :

1. F(A,B,C,D)=∑(1,3,4,6,9,11,12,14)
ANS. B´D+BD´
2. F(A,B,C,D)=∑(1,3,4,6,9,10,11,12,14)
ANS. . B´D+BD´+AB´C
OR . B´D+BD´+ACD´
3. F(A,B,C,D)=∑(0,1,2,3,11,12,13,14,15)
ANS. A´B´+AB+ACD
4. F(A,B,C,D)=∑(0,2,4,6,8,9,10,14)
ANS.A´D´+CD´+AB´C´
5. F(A,B,C,D)=∑(0,2,4,5,7,8,10,12,13,15)
ANS. BD+B´D´
6. F(A,B,C,D)=∑(0,2,4,5,7,8,10,12,13,15)
ANS. C´D´+BD+B´D´
7. F(A,B,C,D)=∑(0,1,3,4,5,7,8,9,11,12,13,15)
ANS.C´+D
8. F(A,B,C,D)=∑(5,6,7,8,9,12,13,14,15)
ANS.BD+BC+AC´
9. F(A,B,C,D)=∑(0,4,5,6,7,8,10,12,1314,15)
ANS.C´D´+B+AD´
10. F(A,B,C,D)=∑(0,2,4,5,6,7,8,10,12,13,14,15)
ANS. D´+B
11. F(A,B,C,D)=∑(0,2,4,6,10,11,13,14)
ANS. A´D´+CD´+AB´C+ABC´D
12. F(A,B,C,D)=∑(0,2,7,8,10,15)
ANS. BCD+B´D´
13. M2+M3+M5+M7+M9+M11+M13
14. M0+M3+M4+M8+M9+M10+M11+ M12+M3
15. M0+M2+M4+M8+M9+M10+M11+M12+M13

1. State and prove De- Morgan’s theorems algebraically.

Ans. De- Morgan’s 1st theorem (A+B)’ =A’ . B’


Proof: If we consider, X= (A+B) then X’=(A+B)’.
Boolean rule is : X.X’= 0 (Complementarily law)
i.e.,(A+B).(A+B)=0
So, to prove the De- Morgan’s 1st thermo: (A+B)’ =A’.B’
We have to show that : X.X’=(A+B).(A’.B’)=0
LHS=(A+B)(A’.B’)
=(A.A’.B’)+(B.A’.B’)
=(0.B’)+(0.A’)=0+0
=0=RHS
Al Ameen Pre University College, Bangalore
Subject: Computer Science

De- Morgan’s 2nd theorem(A.B)’ =A’ + B’


Proof: If we consider, X= A.B; then X’=(A . B)’.
To prove the De- Morgan’s 2nd theorem: (A . B)’ =A’ + B’
To prove that X . X’ = (A . B).(A’ + B’)=0(Since X. X’= 0)
LHS=(A.B.A’)+(A.B.B’) (SINCE X(Y+Z)=XY+XZ)
=(0.B)(A.0)
=0+0=0= RHS

2. State Principle Of Duality.


ANS. The principle of duality states that we can derive a Boolean relation from another Boolean relation by:
i. Changing each AND(.) with an OR(+) symbol and vice versa.
ii. Interchanging each 0 with 1 and 1with 0.
e.g.; 1 + 0 = 1 its dual is 0.1= 0
A .1 = A its dual is A + 0 = A
1 + A’ =1 its dual is 0.A’=0
1.A’= A’ its dual is 0+A’=A’

3.Sstate Absorption Laws.

Ans. i . X+X.Y=X ii. X.(X+Y)=X

=X.1+X.Y =X.X+X.Y (Since.1=X)

= X(1+Y) =X(1+Y) (Since 1+y=y)

= X= RHS =X.1=X=RHS
Al Ameen Pre University College, Bangalore
Subject: Computer Science

Basic Concept of OOP

1. Name some object oriented programming Languages.


Ans. C++,Java, Ada ,Small tal, VC++ etc.
2. Which operator is used to access the members of a class?(How do you access a member function using object?)
Ans. The dot(‘.’) operator or class member access operator. The dot operator is used to connect the object
and the member as like objectName.member (e.g.: object.membrFn())
3. What is the significance of :: operator?
Ans. The scope resolution operator(::) specifies the class to which the member being declared belongs to.(::
is commonly used to define a member outside a class)
4. Is it possible to access a member outside a class?(which member of a class can be accessed outside a class?)
Ans. Yes, Public member of a class can be accessed outside the class definition.
5. In C++,Which access specifier is implicitly used in a class? OR In C++, What is the default access specifier
(or modifier) of a member of a class.
Ans. Private access specifier (modifier) by default.(A member becomes private if no access modifier is
mentioned).
5—Marks
1. Write the features of OOP/write the Characteristics of OOP.
Ans. Some of the important features of object oriented programming are.
i. Objects
ii. Classes
iii. Data Encapsulation
iv. Data Abstraction
v. Polymorphism
vi. Inheritance
vii. Dynamic Binding
viii. Message passing etc.
i. Objects:-- An object is a instance of a class. it is a variable of a class data type. Every object must
belong to a particular class.
ii. Classes:--A class is defined as the blue print of an object, which describes the object. OR
Class is a user defined data type which contain data members and member function.
iii. Data Encapsulation:-- Data Encapsulation combines both data and functions into a single unit called
class. Data Encapsulation prevents direct access to data i.e., the data is hidden from the users. The
prevention of direct access to data by the users is called as data hiding. Data hiding help in securing
the data(data security).
iv. Data Abstraction:--It refers to the act of representing essential features without including the
background details.
v. Polymorphism:-- Poly means many, morph means form. Polymorphism means “many forms”.
It is the ability of processing data in more than one form. In C++, Polymorphism is implemented
through Function Overloading and Operator overloading.
vi. Inheritance:--It is the process of creating a new class from an existing class or base class.
vii. Dynamic Binding:--Binding is the process of connecting one program to another, Dynamic binding
means code associated with a procedure call is known only at the time of program execution routine.
viii. Message Passing:--The processing of data in object oriented programming is carried out by sending
messages to objects.
Al Ameen Pre University College, Bangalore
Subject: Computer Science

2. What are the limitation of OOP


 OOP has no set standards.
 Conversion of real world problem into object oriented model is difficult for some system.
 Some developers may find it difficult initially to get used to OOP concepts.
 The classes are overly generalized.
 The adaptability of flow diagrams and object oriented programming using classes and objects is a
complex process.

3. What are the Applications of OOP.


 Computer graphic applications
 CAD/CAM software.
 Object- Oriented Database.
 User interface design such as windows.
 Real-time system.
 Simulation and Modeling.
 Artificial intelligence and Expert systems.

4. Write the Advantages of OOP.


 The programs are modularized based on the principle of classes and objects.
 Linking code & object allows related objects to share common code. This reduces code duplication
and code reusability.
 Data is encapsulated along with functions. Therefore external non-member function cannot access or
modify data, thus providing data security.
 Easier to develop complex software, because complexity can be minimized through inheritance.
 The concept of data abstraction separates object specification and object implement.
 Creation and implementation of OOP code is easy and reduces software development time.
 OOP can communicate through message passing which makes interface description with outside
system very simple.

You might also like