What is a programming language?
A language used to write instructions for a computer.
Name some examples of programming languages.
Python, Java, C, C++, and JavaScript.
What is procedural programming?
A programming approach using a sequence of steps executed top to bottom.
How does procedural programming execute instructions?
From top to bottom in sequence.
What is the first step in the procedural sequence for making tea?
Boil water.
What is the last step in the procedural sequence for making tea?
Serve the tea.
What is a main limitation of procedural programming regarding code reuse?
Procedural programming has poor code reusability.
Why is error checking difficult in procedural programming for large programs?
Because procedural programming leads to dependent code making error checking hard.
Which programming paradigm is unsuitable for real-world applications due to maintenance issues?
Procedural programming is unsuitable for real-world applications due to difficult maintenance.
What is object-oriented programming?
An approach designing software using classes and objects representing real-world entities.
Which elements does object-oriented programming combine into objects?
Data and the functions that operate on it.
Why is code reusability important in object-oriented programming?
It is achieved through inheritance.
How does object-oriented programming enhance code security?
By using access control.
What does object-oriented programming use to hide unnecessary details?
Abstraction and encapsulation.
How does object-oriented programming manage complexity?
By managing complexity level by level.
What is a class in programming?
A class is a user-defined data type and blueprint containing data members and member functions.
What does an object represent in programming?
An object is an identifiable instance of a class representing a real-world entity through state and behaviour.
What represents an object's state?
An object's state is represented by its attributes.
What represents an object's behaviour?
An object's behaviour is represented by its methods and responses to other objects.
What is a data member in a class?
A data member is a variable declared inside a class.
Give examples of data members in a student class.
Examples include roll number, name, or marks.
What is a method in a class?
A method is a block of code defined inside a class that performs a specific task.
What is encapsulation in object-oriented programming?
Encapsulation is wrapping data and functions into a single unit with controlled access.
How does data abstraction differ from information hiding?
Data abstraction shows essential info while hiding details; information hiding protects sensitive data.
What is inheritance in object-oriented programming?
Inheritance allows a class to derive properties from another class.
What does polymorphism enable in object-oriented programming?
Polymorphism allows operations to appear in multiple forms with different behaviors.
What is binding in programming?
Binding associates a method call with the actual method executed.
What is static binding also called?
Early binding.
When does static binding link a method call to its implementation?
At compile time.
When does dynamic binding link a method call to its implementation?
At runtime based on the actual object.
How does static binding compare to dynamic binding in speed and flexibility?
Static binding is faster and less flexible.
Why is dynamic binding more flexible but slower?
Because its method is determined during execution.
What is message passing in object-oriented programming?
One object sends a request to another to invoke a method and perform an operation.
What does code reusability mean in OOP?
Writing code once and using it multiple times.
How does OOP achieve code reusability?
Through inheritance and reusable classes or methods.
What is data redundancy?
Storing the same piece of data in two separate places.
How can reusable common class definitions reduce data redundancy?
By reducing repeated functionality across classes.
How does OOP improve code maintenance?
By allowing existing code to be modified without repeated rework.
What does OOP security protect?
An object's data from unauthorized or accidental access.
How does OOP mainly protect data security?
Through encapsulation and data hiding.
Test your knowledge with 18 questions on Foundations of Object-Oriented Programming.
1. What is the primary purpose of a programming language?
2. Which sequence best illustrates procedural programming when making tea?
Review the complete course in the study sheet for Foundations of Object-Oriented Programming.
See study sheet →Import your course and AI generates flashcards in 30 seconds.
Flashcard generator