Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views7 pages

Grade 12 Control Test THEORY MEMO May 2022

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 7

Grade 12, Information Technology, Practical Test Page 1 of 7

Grade 12, Information Technology, Practical Test Page 2 of 7


13 May 2022 Information Technology
Grade 12 OOP Control Test MEMO

Examiner: Mr Dill Marks: 80


Moderator: Mr Freeman Time: 1 ¾ hours

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.

Each wedding booking has the following information:


 Bride – the full name of the bride.
 Groom – the full name of the groom.
 Wedding Date – the date of the wedding.
 Venue – the booked venue (either "Garden" or "Lake").
 Number of Guests – the total number of guests attending the wedding.
 External caterer – whether the wedding will use an external caterer or
the farm’s catering staff

Grade 12, Information Technology, Practical Test Page 3 of 7


 Total cost of the event – how much the total cost of the event will be
 Catering package – the type of catering package chosen (if not using
an external caterer)

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.

 Country Fare at R 275.00 per person


 Family at R325.50 per person
 Lux Selection at R580.00 per person

Question 1: Object Orientated Programming Theory

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()

Grade 12, Information Technology, Practical Test Page 4 of 7


+ toString(): String

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)

Grade 12, Information Technology, Practical Test Page 5 of 7


Any one of: 
checkCapacity(sVenue: String)
prepareQuote()
(c) A function
Any one of: 
getWeddingDate()
getVenue()
getNumGuests()
checkCapacity(sVenue: String)
toString() (1)
(d) A procedure
Any one of: 
setVenue(sVenue: String)
setWeddingDate(dDate: Date)
setCaterType(cType: Char);
prepareQuote() (1)
(e) A parameterised procedure
Any one of: 
setVenue(sVenue: String)
setWeddingDate(dDate: Date)
setCaterType(cType: Char);
(1)
1.1.7 The class diagram shows a toString method. Explain the purpose
of a toString method in an object class.
Provide a way to view/display the values  stored in each of the
class attributes  at one time. (2)
1.1.8 Write down a section of pseudocode to show how the
checkCapacity method will determine whether a venue is big
enough for a particular wedding party. The method must return a
message of either “Venue suitable” or “Venue too small” depending
on the number of guests.
Check venue and matching maximum size (could be AND or
Nested as shown) 
IF … ELSE for correct message 
Both venues done using and ELSE 
IF Venue = Garden Venue then
IF Number of Guests <= 130 then
Message = “Venue suitable”
else (3)

Grade 12, Information Technology, Practical Test Page 6 of 7


Message = “Venue too small”
End IF
ELSE IF Venue = Lake Venue then
IF Number of Guests <= 200 then
Message = “Venue suitable”
ELSE
Message = “Venue too small”
END IF
END IF ELSE
Display Message
[20]

Grade 12, Information Technology, Practical Test Page 7 of 7

You might also like