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

ASSIGNMENT 2: THEORY SOLUTIONS NEW LME3701 ASSIGNMENT 2 | DUE 27 SEPTEMBER 2024 BOTH THEORY SOLUTIONS

Beoordeling
-
Verkocht
-
Pagina's
2
Cijfer
A+
Geüpload op
26-09-2024
Geschreven in
2024/2025

ASSIGNMENT 2: THEORY SOLUTIONS NEW LME3701 ASSIGNMENT 2 | DUE 27 SEPTEMBER 2024 BOTH THEORY SOLUTIONS 1.What is the purpose of the keywords public and private in the class declaration? - :The public keyword is used to declare a member variable or function that may be directly accessed from outside the class. The private keyword is used to declare a member variable or function that cannot be directly accessed from outside the class. These members can only be accessed/modified with the use of an accessor/mutator function. 2. What is the difference between a class and an object? - :A class is a user defined type that defines a collection of properties and methods which can be accessed by creating an instance of that class. An object is an instance of a class. It is usually a real-world entity. 3.What does it mean to 'instantiate' an object? - :Instantiating an object is when we create an instance of an object. The object is given a name and created in memory. 4. What is the purpose of a constructor? - :A constructor is used to initialize an object when it is created. 5. What is the difference between the default constructor and the overloaded constructor? - :Both have the same name that matches the class name, A default constructor is one that takes no parameters and is automatically generated if the user doesn't define one. It is used to assign default values to the member variables. An overloaded constructor takes one or more parameters that assign custom values to the member variables. 6. What is the purpose of a destructor? - :A destructor is used to free up resources used by an object, it deallocates the memory and performs other cleanup actions. 7. What is the purpose of an accessor? - :An accessor is used to access/read private class data from outside the class.

Meer zien Lees minder
Instelling
Vak








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

Geschreven voor

Vak

Documentinformatie

Geüpload op
26 september 2024
Aantal pagina's
2
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

ASSIGNMENT 2: THEORY SOLUTIONS
NEW LME3701 ASSIGNMENT 2 | DUE 27 SEPTEMBER 2024 BOTH THEORY
SOLUTIONS

1.What is the purpose of the keywords public and private in the class declaration? - :The public
keyword is used to declare a member variable or function that may be directly accessed from
outside the class.
The private keyword is used to declare a member variable or function that cannot be directly
accessed from outside the class. These members can only be accessed/modified with the use of
an accessor/mutator function.

2. What is the difference between a class and an object? - :A class is a user defined type that
defines a collection of properties and methods which can be accessed by creating an instance of
that class.
An object is an instance of a class. It is usually a real-world entity.

3.What does it mean to 'instantiate' an object? - :Instantiating an object is when we create an
instance of an object. The object is given a name and created in memory.

4. What is the purpose of a constructor? - :A constructor is used to initialize an object when it is
created.

5. What is the difference between the default constructor and the overloaded constructor? - :Both
have the same name that matches the class name,
A default constructor is one that takes no parameters and is automatically generated if the user
doesn't define one. It is used to assign default values to the member variables.
An overloaded constructor takes one or more parameters that assign custom values to the
member variables.

6. What is the purpose of a destructor? - :A destructor is used to free up resources used by an
object, it deallocates the memory and performs other cleanup actions.

7. What is the purpose of an accessor? - :An accessor is used to access/read private class data
from outside the class.

8. What is the purpose of a mutator? - :A mutator is used to modify/set/change private class data
from outside the class.

9. What is the purpose of the scope resolution operator? - :A scope resolution operator can be
used to:
• Access a global variable when there is a local variable with the same name
• Define a class function from outside the class
• Access a class's static variables

10.What is the difference between the scope resolution operator and the dot operator? - :A scope
resolution operator is used with a class name. It is two consecutive colons.
$3.99
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
mastermynds

Maak kennis met de verkoper

Seller avatar
mastermynds Academie voor Natuurgeneeskunde
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
0
Lid sinds
1 jaar
Aantal volgers
0
Documenten
13
Laatst verkocht
-
Test Tackler

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

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