0% found this document useful (0 votes)
18 views4 pages

1 To 10 Question

Procedure oriented programming involves breaking tasks down into a collection of variables, routines, and subroutines carried out in a systematic sequence of instructions. Object oriented programming organizes software around objects that have attributes and behaviors rather than functions and logic. Some key benefits of OOP include modularity, code reuse through inheritance, and flexibility through polymorphism. The main differences between OOP and POP are that OOP focuses on data as objects rather than procedures, follows a bottom-up approach, and provides features like access specifiers, data hiding and security.

Uploaded by

Saad Ali
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)
18 views4 pages

1 To 10 Question

Procedure oriented programming involves breaking tasks down into a collection of variables, routines, and subroutines carried out in a systematic sequence of instructions. Object oriented programming organizes software around objects that have attributes and behaviors rather than functions and logic. Some key benefits of OOP include modularity, code reuse through inheritance, and flexibility through polymorphism. The main differences between OOP and POP are that OOP focuses on data as objects rather than procedures, follows a bottom-up approach, and provides features like access specifiers, data hiding and security.

Uploaded by

Saad Ali
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/ 4

1. Explain procedure and object oriented programming.

Procedure oriented programming :

Procedural Programming is a programming language that follows a step-


by-step approach to break down a task into a collection of variables and
routines (or subroutines) through a sequence of instructions. Each step
is carried out in order in a systematic manner so that a computer can
understand what to do.

Example:

To develop a simple Bank Account App procedural: Creating an account


for an individual ( account ) Getting an account to deposit or withdraw
funds ( get Account , deposit , withdraw )

Object oriented programming

Object oriented programming (OOP) is a computer programming model


that organizes software design around data, or objects, rather than
functions and logic. An object can be defined as a data field that has
unique attributes and behavior.

Example:

The simplest way to explain object-orientated programming to a kid is to


use something like a car as an example. A car has a model name, a
colour, a year in which it was manufactured, an engine size and so on.

2. List the benefit of oop.


Advantages of Object-Oriented Programming
 Modularity for easier troubleshooting.
 Reuse of code through inheritance.
 Flexibility through polymorphism.
 Effective problem solving.
3. Give the difference between oop and pop.

OOP POP
Program divided into a parts know Program are divided into functions
as objects
The main focus of oop is on the The main focus of pop is on the
data procedures
It follows bottom up approach It follow top down approach
It has access specifiers such as POP does not have any access
public. Private etc specifier
It provides data hiding, data POP does not provide any data
associated with the program , so security
security is provide
Ease of modification Modification is difficult
EXAMPLLE:java,Perl EXAMPLE:C,COBOL etc

4. Explain the basic concept of oop.

Object-oriented programming (OOP) is a computer programming model


that organizes software design around data, or objects, rather than
functions and logic. An object can be defined as a data field that has
unique attributes and behavior.

5. List the application of oop.

Applications of OOP:
 Real Time Systems.
 Client Server System.
 Hypertext and Hypermedia.
 Object Oriented Database.
 Neural Networks and Parallel Programming.
 AI Expert Systems.
 Simulation and Modeling System.
 Office Automation Systems.

6. Explain the structure of c++ program.


Structure of a C++ Program. Programs refer to a sequence of instructions
or statements. These statements are what form the structure of a C++
program. Moreover, the C++ program structure divides into several
sections which are namely headers, class definition, member functions
definitions and main function.

Declaration section includes different library functions and header files.


All preprocessor directives are written in this section.

Global declaration includes structure, class, variable. All global variables


are declared here.

Main() function is an entry point for all the function. Every C++
program starts with main() function.me, citizenship number and salary.

7. Explain tokens.

A token is the smallest element of a C++ program that is meaningful to


the compiler. The C++ parser recognizes these kinds of tokens: Keywords.
Identifiers
In general, a token is an object that represents something else, such as
another object (either physical or virtual), or an abstract concept as

Example:

A gift is sometimes referred to as a token of the giver's esteem for the


recipient. In computers, there are a number of types of tokens.

8. Explain referenced variable with example.

A reference variable is one that refers to the address of another variable.


It represents the name of another variable, location, or value. Once you
initialize the variable references, that variable will be referred to using
the variable name or reference name

Example:
Suppose you make peter a reference (alias) to Paul , you can refer to the
person as either peter or Paul .

9. Explain scope resolution operator with example.


The :: (scope resolution) operator is used to qualify hidden names so
that you can still use them. You can use the unary scope operator if a
name space scope or global scope name is hidden by an explicit
declaration of the same name in a block or class.

Example:

If you declare a variable x within a function, x is only visible within that


function body

10.Explain memory management operator with example

Memory management in C++ is a technique of managing the computer


memory and assigning required memory space to the programs for
execution. It is almost relatable and is based on the same concept as
other Programming languages.
There's two types of memory in c++ the stack and the heap.

You might also like