100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

cos2614 exam pack 2023 , pass with 100%

Beoordeling
-
Verkocht
1
Pagina's
39
Cijfer
A+
Geüpload op
12-10-2023
Geschreven in
2023/2024

This document contains everything you need to pass cos2614

Instelling
Vak











Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
12 oktober 2023
Aantal pagina's
39
Geschreven in
2023/2024
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

BASIC CONCEPTS OF OBJECTS ORIENTED PROGRAMMING

Review of the following OOP concepts



1. Objects



2. Classes



3. Data abstraction and encapsulation



4. Inheritance



5. Polymorphism



6. Dynamic binding



7. Message passing



OBJECTS




Objects are the basic run-time entities in an object-oriented system. They may represent a person, a
place, a bank account, a table of data, or any item that the program must handle.



The fundamental idea behind the object-oriented approach is to combine both data and function
into single units and these units are called objects.



The term objects mean a combination of data and programs that represent some real word entity.
For example: consider an example named Siya; Siya is 25 years old and his salary is R2500. The Amit
may be represented in a computer program as an object. The data part of the object would be
(name: Siya, age: 25, salary: R2500)

,The program part of the object may be a collection of programs (retrieve of data, change age, change
of salary). In general, even any user-defined type-such as an employee may be used. In the Siya
object the name, age, and salary are called attributes of the object.



CLASS:




A group of objects that share common properties for the data part and some program parts is
collectively called a class.



In C ++ a class is a new data type that contains member variables and member functions that operate
on the variables.




DATA ABSTRACTION :



Abstraction refers to the act of representing essential features without including the background
details or explanations. Classes use the concept of abstraction and are defined as attributes and
functions to operate on the attributes.



DATA ENCAPSULATION:




The wrapping up of data and function into a single unit (called class) is known as encapsulation. The
data is not accessible to the outside world and only those functions which are wrapped in the class
can access it. These functions provide the interface between the object's data and the program.



INHERITANCE :




Inheritance is the process by which objects of one class acquire the properties of another class. The
concept of inheritance provides the idea of reusability. This means that we can add additional
features to an existing class without modifying it. This is possible by designing a new class that will
have the combined features of both classes.

,POLYMORPHISM:




Polymorphism means the ability to take more than one form. An operation may exhibit different
instances. The behavior depends upon the type of data used in the operation. Polymorphism is a
language feature that allows a function or operator to be given more than one definition. The types
of the arguments with which the function or operator is called determine which definition will be
used.



DYNAMIC BINDING :




Binding refers to the linking of a procedure call to the code that is executed in response to the call.
Dynamic binding means the code associated with a given procedure call is not known until run-time.
It is associated with a polymorphic reference depending upon the dynamic type of that reference.



MESSAGE PASSING :




An object-oriented program consists of a set of objects that communicate with each other.



A message for an object is a request for execution of a procedure and therefore will invoke a function
(procedure) in the receiving object that generates the desired result. Message passing involves
specifying the name of the object, the name of the function (message), and the information to be
sent.




BENEFITS OF OOP:



OOP offers several benefits to both the program designer and the user. Object-oriented contributes
to the solution of many problems associated with the development and quality of software products.

, The principal advantages are :



1. Through inheritance we can eliminate redundant code and extend the use of existing classes.



2. We can build programs from the standard working modules that communicate with one another,
rather than having to start writing the code from scratch. This leads to saving development time and
higher productivity.



3. This principle of data hiding helps the programmer to build secure programs that can’t be
invaded by code in other parts of the program.



4. It is possible to have multiple instances of an object co-exist without interference.



5. It is easy to partition the work into a project based on objects.



6. Object-oriented systems can be easily upgraded from small to large systems.



7. Message passing techniques for communication between objects make the interface description
with external systems much simpler.



8. Software complexity can be easily managed.

LESSON

LESSON
CLASSES

A Class is a group of objects that share common properties and relationships.
In C++, a class is a new data type that contains member variables and member function
s that operates on the variables. A class
is defined with the keyword class. It allows the data
to be hidden, if necessary from external use. When we define
a class, we are creating a new abstract data type that can be treated like any other built-
in data type.
Generally, a class specification has two parts:

a) Class declaration

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
elenaprowriter University of South Africa (Unisa)
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
101
Lid sinds
4 jaar
Aantal volgers
70
Documenten
20
Laatst verkocht
2 maanden geleden

3,5

13 beoordelingen

5
3
4
4
3
4
2
1
1
1

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen