Podcast
Questions and Answers
What is the main design method used in procedural programming?
What is the main design method used in procedural programming?
- Incremental Design
- Top Down Design (correct)
- Modular Design
- Bottom Up Design
What is a significant difficulty associated with procedural programming?
What is a significant difficulty associated with procedural programming?
- Changes in the main procedure can affect downstream procedures (correct)
- Procedural languages require more memory
- Modules cannot be tested separately
- Procedural programming cannot be used in large projects
What aspect of object-oriented programming addresses issues found in procedural programming?
What aspect of object-oriented programming addresses issues found in procedural programming?
- Automatic availability of class instances (correct)
- Enhanced user interfaces
- Improved testing methods
- Separation of code and data
How do modules function in procedural programming?
How do modules function in procedural programming?
What can happen to sub procedures when changes are made to the main procedure in a procedural programming context?
What can happen to sub procedures when changes are made to the main procedure in a procedural programming context?
What character signifies the end of a line in a text stream in C++?
What character signifies the end of a line in a text stream in C++?
Which programming languages are primarily known for being object-oriented?
Which programming languages are primarily known for being object-oriented?
What is the primary way in which object-oriented programming enhances security compared to procedural-oriented programming?
What is the primary way in which object-oriented programming enhances security compared to procedural-oriented programming?
In C++, what do streams refer to?
In C++, what do streams refer to?
Which of the following statements is correct regarding global and local data in programming?
Which of the following statements is correct regarding global and local data in programming?
Which type of stream contains raw binary data values interpreted according to their memory representation?
Which type of stream contains raw binary data values interpreted according to their memory representation?
What is the purpose of the 'cin.get()' function in C++?
What is the purpose of the 'cin.get()' function in C++?
What differentiates functions in procedural-oriented programming from objects in object-oriented programming?
What differentiates functions in procedural-oriented programming from objects in object-oriented programming?
What is a fundamental disadvantage of procedural programming languages?
What is a fundamental disadvantage of procedural programming languages?
Which statement best describes object-oriented programming?
Which statement best describes object-oriented programming?
How does object-oriented programming improve code maintainability?
How does object-oriented programming improve code maintainability?
What does the term 'class' indicate in object-oriented programming?
What does the term 'class' indicate in object-oriented programming?
Which of the following is NOT a key characteristic of object-oriented programming?
Which of the following is NOT a key characteristic of object-oriented programming?
Which aspect of object-oriented programming contributes to its flexibility?
Which aspect of object-oriented programming contributes to its flexibility?
In object-oriented programming, what is primarily meant by 'inheritance'?
In object-oriented programming, what is primarily meant by 'inheritance'?
What is the relationship between an object and a class in object-oriented programming?
What is the relationship between an object and a class in object-oriented programming?
What is a key characteristic of procedural programming languages?
What is a key characteristic of procedural programming languages?
Which of the following is NOT a feature of procedure-oriented programming?
Which of the following is NOT a feature of procedure-oriented programming?
In a procedure-oriented programming language, how is a function typically defined?
In a procedure-oriented programming language, how is a function typically defined?
Which of the following programming languages is an example of a procedure-oriented programming language?
Which of the following programming languages is an example of a procedure-oriented programming language?
What is the main purpose of the main program in procedural programming?
What is the main purpose of the main program in procedural programming?
What does the term 'top-down approach' refer to in the context of procedure-oriented programming?
What does the term 'top-down approach' refer to in the context of procedure-oriented programming?
Which of the following best describes the nature of data in procedural programming languages?
Which of the following best describes the nature of data in procedural programming languages?
Which of the following function call examples follows the proper syntax for procedural programming?
Which of the following function call examples follows the proper syntax for procedural programming?
Flashcards
Procedural Programming
Procedural Programming
A programming paradigm that structures a program as a sequence of instructions or procedures. It emphasizes the breakdown of a program into smaller, self-contained modules called functions or subroutines.
Object-Oriented Programming (OOP)
Object-Oriented Programming (OOP)
A programming paradigm that uses objects to represent entities in a program. It focuses on data and the operations (methods) that can be performed on that data.
Programming Language Syntax
Programming Language Syntax
A set of rules that specify the syntax and semantics of a programming language, defining how code should be written.
Function in Programming
Function in Programming
Signup and view all the flashcards
Global Data
Global Data
Signup and view all the flashcards
Top-Down Approach
Top-Down Approach
Signup and view all the flashcards
Object-Oriented Programming Language
Object-Oriented Programming Language
Signup and view all the flashcards
Procedure-Oriented Programming Language
Procedure-Oriented Programming Language
Signup and view all the flashcards
Inheritance
Inheritance
Signup and view all the flashcards
Procedure
Procedure
Signup and view all the flashcards
Top-Down Design
Top-Down Design
Signup and view all the flashcards
Object-Oriented Programming
Object-Oriented Programming
Signup and view all the flashcards
Data Security in Object-Oriented Programming
Data Security in Object-Oriented Programming
Signup and view all the flashcards
Class
Class
Signup and view all the flashcards
Object
Object
Signup and view all the flashcards
Unrestricted Access in Procedural Programming
Unrestricted Access in Procedural Programming
Signup and view all the flashcards
Real-World Modeling in Procedural Programming
Real-World Modeling in Procedural Programming
Signup and view all the flashcards
C++ I/O Streams
C++ I/O Streams
Signup and view all the flashcards
Text Stream
Text Stream
Signup and view all the flashcards
Binary Stream
Binary Stream
Signup and view all the flashcards
Cascading of Input/Output Operators
Cascading of Input/Output Operators
Signup and view all the flashcards
Reading and Writing Characters and Strings
Reading and Writing Characters and Strings
Signup and view all the flashcards
cin
cin
Signup and view all the flashcards
cout
cout
Signup and view all the flashcards
iostream
iostream
Signup and view all the flashcards
Study Notes
Course Information
- Course Title: Object Oriented Design and Programming
- Course Code: 18CSC202J
- Unit: 1
- Prepared by: CINTEL Team
- Date: 8/24/2022
Procedural vs Object Oriented Programming
- Procedural Programming: A program is a list of instructions. Larger programs are divided into smaller programs called functions. Each function has a clearly defined purpose and a clearly defined interface to the other functions in the program.
- Procedural language data is usually global and shared by all the functions. Procedural language designs are commonly Top-Down. Languages like C, COBOL, and FORTRAN use this approach.
- Object-Oriented Programming: Objects of the program interact by sending messages to each other, and data security is enhanced because data can only be accessed through its instances. Object-oriented programming is meant to address difficulties in procedural programming with regards to software maintaining which leads to time-consuming processes.
C Function Aspects
- Function Declaration: Return-type function-name(argument list); Eg: int add(int a, int b);
- Function Definition: Return-type function-name(argument list){body of function;} Eg: int add(int a, int b){int c; c=a+b; return c;}
- Function Call: Function-name(argument list); Eg: add(5,10);
Features of Procedure Oriented Programming
- Smaller programs are used
- Larger programs are divided into smaller programs known as functions.
- Each function has a clearly defined purpose
- Each function has a clearly defined interface to the other functions
- Data is global and shared by almost all the functions
- Top-Down approach used in program design
Examples of Procedure Oriented Programming Languages
- COBOL
- FORTRAN
- C
Sample COBOL Program
- Shows program structure with IDENTIFICATION, ENVIRONMENT, and DATA divisions. The WORKING-STORAGE section defines variables (e.g., A, B, ANS) to store numerical values.
- The PROCEDURE DIVISION describes the steps in the program: main processing, adding the variables, displaying results, and terminating.
Disadvantages of Procedural Programming
- Unrestricted access: Functions have unrestricted access to global data.
- Real-world modeling: Unrelated functions and data do not effectively model real-world objects, which typically have attributes (data) and behavior (functions).
Object-Oriented Concepts
- Objects in a program interact by sending messages to each other. This improves data security, as data can only be accessed through its instances.
- Every object has its own memory.
- Computation is performed through objects communicating with each other.
- Every object is an instance of a class. A class simply groups similar objects.
- A class is the repository for behavior associated with an object, meaning all objects from the same class perform the same actions.
- Classes are organized in a tree structure known as the inheritance hierarchy.
- Memory and behavior associated with instances of a class are automatically available to any class associated with a descendant in this tree structure.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.