Computing 4.1 Fundamentals Of Programming
With Complete Solutions Latest Update
What is recursion? - correct answers The process in which a block of code that is defined in terms of itself
makes a call to itself (code repeats itself)
What is the structured approach to program design? - correct answers It's a method of designing programs in
order to keep them easy to understand and manage.
What are the 4 basic structures used in the structured approach to program design? - correct answers -
Assignment
- Sequence
- Selection
- Iteration
What is an object in object-oriented programming? - correct answers Objects are used as containers of both
data and instructions. New objects are created from classes in a process called instantiation.
What is a class in OOP? - correct answers An object is defined as an instance of a class. A class is like a
blueprint for objects - they specify what properties and methods objects of their type will have.
What is Encapsulation in Object-Oriented Programming (OOP)? - correct answers Encapsulation is the name
given to the process of combining methods and procedures to form an object in OOP. An object is said to
encapsulate its contents, forming a single entity.
Why is Encapsulation important in large programs in OOP? - correct answers Encapsulation allows the
development of large programs to be split across a team of developers, each of whom can be allocated a class
to develop.
, As long as a developer knows the methods which belong to other classes, they can develop their own class
without knowing the specific implementation of methods in other classes.
What is inheritance in OOP? - correct answers A class can inherit another class. Inheritance allows one class to
share the properties and methods of another class, while having its own properties and methods too.
What is polymorphism in OOP? - correct answers Polymorphism occurs when objects are processed differently
depending on their class.
For example, a method may work differently for two objects depending on what their classes are - the method
would take into account the object's class and treat it accordingly.
What is overriding in OOP? - correct answers An overridden method has the same name as a method in an
inherited class but a different implementation.
What is Association in OOP? - correct answers If two objects are associated, they can be described as having a
'has a' relationship. For example, objects of the classes Car and Driver could be associated, since a Car HAS A
Driver.
An associated object forms part of its container object as a property.
What are the 2 types of association? How do they differ? - correct answers The two types are Aggregation and
Composition.
Aggregation is the weaker of the two. When an object is associated with another by aggregation, it will still
exist if its containing object is destroyed
E.g - a car being scrapped won't affect it's passengers
Composition is the stronger of the two. If two objects are associated by composition and the containing object
is destroyed, the associated object is also destroyed.
E.g - a car being scrapped will also scrap the car's wheels
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Schoolflix. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $14.99. You're not tied to anything after your purchase.