0% found this document useful (0 votes)
22 views12 pages

Feb Test Year 12 Updated

The document is an examination paper for Year 12 Information Technology at Anton Lembede Mathematics, Sciences & Technology Academy, dated February 7, 2025. It consists of programming tasks related to the Delphi programming language, focusing on creating and managing an order system for a small takeaway kitchen. The exam includes specific instructions, supplied files, and detailed questions about programming methods and object-oriented concepts.

Uploaded by

biyelaanele0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views12 pages

Feb Test Year 12 Updated

The document is an examination paper for Year 12 Information Technology at Anton Lembede Mathematics, Sciences & Technology Academy, dated February 7, 2025. It consists of programming tasks related to the Delphi programming language, focusing on creating and managing an order system for a small takeaway kitchen. The exam includes specific instructions, supplied files, and detailed questions about programming methods and object-oriented concepts.

Uploaded by

biyelaanele0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Anton Lembede Mathematics, Sciences & Technology

Academy
School of Innovation & Leadership

YEAR 12

INFORMATION TECHNOLOGY

07 FEBRUARY 2025

MARKS: 80 MARKS EXAMNER: MR MABUZA


DURATION: 2 HOURS MODERATOR: MR NZAMA

This question paper consists of 12 pages.


Information Technology/P1 2 FEBRUARY 2025

INSTRUCTIONS AND INFORMATION

1. This question paper is set with programming terms that are specific to the Delphi
programming language.

2. Make sure that you answer the questions according to the specifications that are
given in each question. Marks will be awarded according to the set requirements.

3. Answer only what is asked in each question. For example, if the question does
not ask for data validation, then no marks will be awarded for data validation.

4. Your programs must be coded in such a way that they will work with any data
and not just the sample data supplied or any data extracts that appear in the
question paper.

5. All data structures must be declared by you, the programmer, unless the data
structures are supplied.

6. Make sure that your Name and Surname appears as a comment in every
program that you code, as well as on every event indicated.

7. At the end of this examination session you must hand in a disk/CD/DVD/flash


disk with all your work saved on it OR you must make sure that all your work has
been saved on the disk space allocated to you for this examination session.
Ensure that all files can be read.

SUPPLIED FILES:

QUESTION 1: QUESTION 2:
Album_U.pas clsOrder.pas
Question3_P.dpr menu.txt
Question3_P.dproj Question3_P.dpr
Question3_P.res Question3_P.dproj
Question3_U.dfm Question3_P.res
Question3_U.pas Question3_U.dfm
Question3_U.pas

Copyright Reserved Please turn over


Information Technology/P1 3 FEBRUARY 2025

QUESTION 1

SCENARIO: Rachel owns a small takeaway kitchen where she specialises in


making 15 different food items which includes a few starters, main meals and
desserts. Clients can choose between anyone of these categories when ordering
something to eat.

Do the following before answering the questions that follow:

 Open the incomplete program in the Question 3 folder.


 Open the incomplete object class unit clsOrder.pas.
 Compile and execute the program.

3.1 [Class Unit]

The incomplete object class (TOrder) contains the declaration of attributes


which describe an Order object.

The complete set of attributes / properties / private fields for an Order object
(a single meal) have been declared as follows:

 fItemName – The description of the item/meal


 fItemType – The type of meal (e.g. Starter / Main Meal /
Dessert)
 fPrepTime – The time (in minutes) taken to prepare a meal.
 fPriceClass – The price class according to which Rachel
manages each meal (There are three: 1, 2 or
3)
 fCost – The cost of an item/meal in Rand (R).

The following methods have also been provided:

 ToString: An incomplete method used to concatenate and return


the attributes of the object as a single string.

 Three accessor methods (GETCost, GETItemType and


GETItemName).

Complete the code in the object class unit (clsOrder) as described in


QUESTION 3.1.1 to QUESTION 3.1.4.

3.1.1 Write a constructor method called Create that will receive the item name,
item type, price class and preparation time as parameters and will assign the
values to the appropriate class attributes. Set the fcost attribute to 0. (6)

3.1.2 Write a mutator method setOrder to receive the item name, item type,
preparation time and cost as parameters and to assign the values to the
appropriate class attributes. (6)

Copyright Reserved Please turn over


Information Technology/P1 4 FEBRUARY 2025

3.1.3 Rachel’s Kitchen uses three price classes listed and calculated as follows:

1 : Cost = R3.50 x PrepTime in minutes


2 : Cost = R5.65 x PrepTime in minutes
3 : Cost = R7.80 x PrepTime in minutes
Exception! : If the item is a T-bone & Chips the cost is
R145.00 regardless of preparation
time.

Write a method called CalcCost that will determine, using the formula
above, and assign the resulting cost of a dish (Order object) to the fCost
attribute. Use the fPriceClass attribute to determine the price class (1, 2, 3
or exception) for the Order object. (8)

3.1.4 Complete the toString method to include:

 Only cash will be accepted if the total cost is less than R50.00, else
a credit card or cash can be used. Generate and add an appropriate
message to the return string of the method.

An example of the return string:

(4)

3.2 [Main Form Unit]


The following interface has been provided:

Copyright Reserved Please turn over


Information Technology/P1 5 FEBRUARY 2025

The following class scope variables are declared:

A text file (Menu.txt) has been supplied in the data folder. Each line in the
text file contains the unprocessed information of an item / meal that can be
ordered.

The CallObject method reads the text file and retrieves the type, the name
and the price class of every meal, as well as the time to prepare the meal.

The Info object is an instance of the declared and compiled TInfo class.

3.2.1 Button [Question 3.2.1]

Add code to the incomplete btnQ3_2_1 event handler to:

o call the CallObject method,

o instantiate objOrder by calling the constructor method of the class


TOrder with the following arguments tempName, tempType,
tempPrep, tempClass,

Copyright Reserved Please turn over


Information Technology/P1 6 FEBRUARY 2025

o to call the appropriate methods of the objOrder object to display the


type, name and cost of a meal in the listbox lbxList.

Example of correct output:

(10)

3.2.2 Button [Question 3.2.2]

The user must select an item / meal from the list in the lbxList component
before the meal information can be retrieved and displayed in the provided
redDisplay component.

Add code to the incomplete btnQ3_2_2 to do the following:

o Instantiate the Info object with the item / meal selected in the listbox
as argument by calling the create method in the TInfo class which
receives a single string as parameter.

NOTE: use the constant variable SelectedMeal if you can’t retrieve


the selected meal from the listbox.

o Call the GetInfo method for the Info object with the following
arguments: tempName, tempType, tempPrep, tempCost.

o Call the appropriate methods for the objOrder object to display the
information of the selected meal from the listbox in the redDisplay
component.

Example of correct output if the Snails item is chosen:

Copyright Reserved Please turn over


Information Technology/P1 7 FEBRUARY 2025

Example of correct output if the Tiramisu item is chosen:

(6)

Total Question 1 [40]

Copyright Reserved Please turn over


Information Technology/P1 8 FEBRUARY 2025

QUESTION 2

Copyright Reserved Please turn over


Information Technology/P1 9 FEBRUARY 2025

Copyright Reserved Please turn over


Information Technology/P1 10 FEBRUARY 2025

Copyright Reserved Please turn over


Information Technology/P1 11 FEBRUARY 2025

Copyright Reserved Please turn over


Information Technology/P1 12 FEBRUARY 2025

TOTAL QUESTION 2 :40


GRAND TOTAL: 80

Copyright Reserved Please turn over

You might also like