Grade 12 Control Test THEORY MEMO May 2022
Grade 12 Control Test THEORY MEMO May 2022
Grade 12 Control Test THEORY MEMO May 2022
Scenario
Sun Valley farm in the Durbanville area uses their beautiful grounds as a
venue for weddings. The farm already has 50 bookings for the year and
needs some software to help them process these bookings.
The farm has two venues that are suitable for weddings:
Garden venue – this venue can hold up to 130 guests for a single
wedding and the venue hire is R205.25 per person.
Lake venue – this venue can hold up to 200 guests for a single
wedding and the venue hire is R145.75 per person.
There can only be one wedding per venue on any given date.
If the farm’s caterers are being used, there are three packages to choose from.
The couple will be able to choose from a range of menus in each package.
1.1 Examine the class diagram below and then answer the questions
that follow. The diagram represents a Wedding class.
Wedding
- fBride: String
- fGroom: String
- fWeddingDate: Date
- fVenue: String
- fNumGuests: Integer
- fExternalCater: Boolean
- fTotalCost: Real;
- fCateringPackage: Char;
- LAKEPP = 145.75
- GARDENPP = 205.25
+ Create(sBride: String, sGroom: String, sDate: Date,
sVenue: String, iGuests: integer, bCaterer: Boolean)
+ getWeddingDate(): Date
+ getVenue(): String
+ getNumGuests(): Integer
+ setVenue(sVenue: String)
+ setWeddingDate(dDate: Date)
+ setCaterType(cType: Char);
+ checkCapacity(sVenue: String): String
- prepareQuote()
1.1.1 The Wedding class makes use of the concept of information hiding.
(a) Explain what feature of the class diagram tells you that
information hiding is being used.
Attributes marked with a minus (-)
Meaning that they have private access and cannot be
accessed by other units using this class (2)
(b) Object orientated programming makes use of the concept
of encapsulation. Explain what this term means.
Occurs when a class combines all the fields and
methods into one unit
OR The grouping of attributes and behaviour in one entity (2)
1.1.2 What is the purpose of the Constructor method in an object class?
Special type method that is used to create an object from the class
template. (1)
1.1.3 Some object classes have an overloaded constructor method.
Explain what it means when a method is overloaded.
When a constructor (method) has more than one signature - the
ability to give two methods (constructors) the same name in the
same class, provided they have different parameter sets . (2)
1.1.4 Examine the class diagram on the previous page. Explain why
there are no mutator (setter) methods for the LAKEPP and
GARDENPP attributes of the class.
Constants
Thuc cannot be changed (2)
1.1.5 Give another term that can be used instead of attribute as used in
the previous question.
Field (1)
1.1.6 Identify one example of each of the following from the class
diagram.
(a) An accessor method.
Any one of:
getWeddingDate()
getVenue()
getNumGuests()
(1)
(b) An auxiliary method (1)