Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

CS3307 ACTUAL Exam Questions and CORRECT Answers

Beoordeling
-
Verkocht
-
Pagina's
7
Cijfer
A+
Geüpload op
31-08-2025
Geschreven in
2025/2026

CS3307 ACTUAL Exam Questions and CORRECT Answers High coupling (bad) - CORRECT ANSWER of functions -C++ friends -Instance variable is another Object Medium Coupling - CORRECT ANSWER data is needed -No variables are other objects -Accesses internal variables without the use -Passing entire data structures when only some -Still accessing the object's variables without functions (directly)

Meer zien Lees minder
Instelling
CS3307
Vak
CS3307

Voorbeeld van de inhoud

CS3307 ACTUAL Exam Questions and
CORRECT Answers
High coupling (bad) - CORRECT ANSWER -Accesses internal variables without the use
of functions
-C++ friends
-Instance variable is another Object


Medium Coupling - CORRECT ANSWER -Passing entire data structures when only some
data is needed
-No variables are other objects
-Still accessing the object's variables without functions (directly)


Low Coupling - CORRECT ANSWER -Constant object passed through
-Variables of passed through object are only accessed through functions


Low Cohesion (bad) - CORRECT ANSWER Non-related function belong to one class



High cohesion (good) - CORRECT ANSWER Related tasks grouped into one class



Encapsulate what varies - CORRECT ANSWER -Put the parts of your code that changes
into separate classes e.g class for flybehaviour where it is overwritten by by flywithwings and
flynoway instead of creating new classes for each duck
-Less duplicate behaviour since ducks that are similar might override the same function and have
the same new function


Code to interface not an implementation - CORRECT ANSWER -Depend on abstractions
, not concrete classes
-Don't just create a baseball player class and baseball team class, create an athlete interface with
different sport classes and a general team class so team works with any sport, not just baseball

, Favour composition over inheritance - CORRECT ANSWER -Use "has-a" relationships
(composition) instead of "is-a" relationship (inheritance), whenever possible
-Bad = rubber duck inheriting from duck and overriding functions
-Good = the ducks having classes that represent their behaviour... flywithwings, flynoway


S - Single Responsibility Principle - CORRECT ANSWER -A class should only have one
reason to change AKA only one job
-Bad (too many responsibilities) = report class for getting data, formatting data, and saving to file
-Good = one report class, one formatting class, one saver class
-Or think car example with automobile, car wash, driver, and mechanic


O - Open / Closed Principle - CORRECT ANSWER -Classes should be open for extension
but closed for modification
-Extend class instead of changing source code if we need different behaviour as doing otherwise
can introduce bugs
-Use inheritance
-Instead of a bunch of if statements in a shape class, have different shape classes override the
function they need


L - Liskov substitution principle - CORRECT ANSWER -Subtypes must be suitable for
their base types
-When you inherit from a base class, you must be able to substitute your subclass for that base
class without affecting program correctness
-Think rectangle and square example, better to just inherit from shape


I - Interface Segregation Principle (ISP) - CORRECT ANSWER -Many client-specific
interfaces are better than one general purpose interface. Clients should not be forced to depend
upon interfaces that they do not use.
-Don't add new methods appropriate to only one or a few implementation classes e.g. a glass
door does not need a timerclient like a timeddoor

Geschreven voor

Instelling
CS3307
Vak
CS3307

Documentinformatie

Geüpload op
31 augustus 2025
Aantal pagina's
7
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$11.99
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF


Ook beschikbaar in voordeelbundel

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.
MGRADES Stanford University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1374
Lid sinds
2 jaar
Aantal volgers
104
Documenten
84393
Laatst verkocht
1 uur geleden
MGRADES (Genius Brains)

Welcome to MGRADES Exams, practices and Study materials The work speaks for itself Me and my team will always make sure you get the best value from the exams markets. I offer the best study and exam materials for a wide range of courses and units. Make your study sessions more efficient and effective. Dive in and discover all you need to excel in your academic journey!

3.8

230 beoordelingen

5
94
4
50
3
51
2
14
1
21

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

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen