Downloaded from hlayiso.com
SENIORSERTIFIKAAT-EKSAMEN/
NASIONALE SENIORSERTIFIKAAT-EKSAMEN
INLIGTINGSTEGNOLOGIE V1
2023
NASIENRIGLYNE
PUNTE: 150
Hierdie nasienriglyne bestaan uit 25 bladsye.
Kopiereg voorbehou Blaai om asseblief
Skip to contentAll 2023 papers 





View all





Information Technology Grade 12 P1 NSC June 2023 Memo (Afr)
Grade 12 Information Technology Paper 1 memorandum from the NSC June Exam 2023 (Afrikaans), 25 pages. Read online or download the free PDF.
Information Technology · Grade 12 · NSC June Exam · 2023. Memorandum. Read online or download the PDF.
- Subject
- Information Technology
- Grade
- Grade 12
- Document type
- Memorandum
- Year
- 2023
- Exam period
- NSC June Exam
- Paper
- 1
- Curriculum
- CAPS
- Pages
- 25
- File size
- 680.3 KB
Free to read online, no sign-up needed
Loading document…
Loading document…
1 of 25
This exam
NSC June Exam 2023
Questions in this paper
Document textSearch extracted text and jump to a page.
Downloaded from hlayiso.com
Inligtingstegnologie/V1 2 DBE/2023
SS/NSS – Nasienriglyne
ALGEMENE INLIGTING:
Hierdie nasienriglyne moet as die basis vir die nasiensessie gebruik word. Dit is
voorberei om deur nasieners gebruik te word. Daar word na alle nasieners
verwag om 'n deeglike standaardiseringsvergadering by te woon om seker te
maak dat die riglyne konsekwent geïnterpreteer en tydens die nasien van die
kandidate se werk toegepas word.
Let op dat leerders wat 'n alternatiewe korrekte oplossing as wat as voorbeeld
van 'n oplossing in die nasienriglyne gegee word verskaf, volle krediet vir die
relevante oplossing moet kry tensy die spesifieke instruksies in die vraestel nie
gevolg is nie of die vereistes van die vraag nie nagekom is nie.
Bylaag A, B, C en D (bladsy 3 tot 10) sluit die nasienrubriek vir elke om te
gebruik vir enigeen van die twee programmeringstale in.
Bylaag E, F, G en H (bladsy 11 tot 24) bevat voorbeelde in programmeringskode
van oplossings vir VRAAG 1 tot VRAAG 4.
Kopieë van Bylaag A, B, C, D en die opsomming van die leerder se punte
(bladsy 3 tot 10) moet vir elke leerder gemaak word en tydens die nasiensessie
voltooi word.
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 3 DBE/2023
SS/NSS – Nasienriglyne
BYLAAG A
VRAAG 1: NASIENRUBRIEK - ALGEMENE PROGRAMMERINGSVAARDIGHEDE
SENTRUMNOMMER: EKSAMENNOMMER:
MAKS. LEERDER-
VRAAG BESKRYWING
PUNTE PUNT
1.1 Knoppie [1.1 – Formatting]
Enige een van skrifgroote of skrifstyl:
Stel die skrifgrootte ('font size') van edtQ1_1 op 14
edtQ1_1.Font.size (1) := 14 (1)
OF 4
Stel skrifstyl ('font style') van edtQ1_1 na onder streep
edtQ1_1.Font.style (1) := [fsUnderline] (1)
Stel die teks van edtQ1_1 op 'Hello world'
Stel die kleur van edtQ1_1 op groen ('green')
1.2 Knoppie [1.2 – Random number]
Genereer 'n lukraakheelgetal in die regte reeks (1 tot 99)
Toets of lukraakgetal 'n enkelsyfergetal is (<=9)
Vertoon die getal omgeskakel na 'n string en 'n boodskap in
pnlQ1_2 wat aandui dat dit 'n enkelsyfergetal is
Anders
Vertoon die getal omgeskakel na 'n string en 'n boodskap in
pnlQ1_2 wat aandui dat dit 'n tweesyfergetal is 8
Konsepte:
Genereer „n lukraakheelgetal (1) in korrekte reeks (1)
Toets of lukraakgetal (1):
o „n Enkelsyfer getal is (1), vertoon getal omgeskakel na „n
string (1) met toepaslike boodskap (1)
o „n Tweesyfer getal is (1), vertoon getal omgeskakel na „n
string met toepaslike boodskap (1)
1.3 Knoppie [1.3 – Area]
Verkry d van edtQ1_3 en skakel om na integer/float
area = 3 * sqrt(3) / 2 * sqr(d) - pi * sqr(d /2) 8
Vertoon die waarde van area in pnlQ1_3 met een desimale
plek
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 4 DBE/2023
SS/NSS – Nasienriglyne
1.4 Knoppie [1.4 – Find]
Verkry sWoord van edtQ1_4.text
Skep en inisialiseer teller
While NOT EOF(tekslêer) doen
Lees word uit die lêer
Verander woorde na hoof/kleinletters
As word uit die lêer = sWoord (of edtQ1_4.text) 11
Inkrementeer teller
As teller > 0 (of toepaslike vlag)
Vertoon getal voorgekom ('occurences') in redQ1_4
Anders (OF as teller = 0 is)
Vertoon “Word not found” in redQ1_4
1.5 Knoppie [1.5 – Booster rocket]
Skep en inisialiseer teller
Kry totale brandstof van input box
omgeskakel na reële/heelgetal
herhaal ('Loop') terwyl totale brandstof >= 200 9
Inkrementeer teller
Brandstof gekry = totale brandstof * 7.5 / 100
Totale brandstof = totale brandstof – brandstof gebruik
Vertoon teller, brandstof gebruik en totale brandstof oor
in netjiese kolomme
geformatteer tot twee desimale plekke
TOTAAL AFDELING A: 40
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 5 DBE/2023
SS/NSS – Nasienriglyne
BYLAAG B
VRAAG 2: NASIENRUBRIEK - DATABASISPROGRAMMERING
SENTRUMNOMMER: EKSAMENNOMMER:
MAKS. LEERDER-
VRAAG BESKRYWING
PUNTE PUNT
2.1 SQL-stellings
2.1.1 Knoppie [2.1.1 – iOS products]
SELECT DeviceID, DeviceName
FROM tblDevices
WHERE OperatingSystem = "iOS"
3
Alternatief:
WHERE OperatingSystem LIKE "iOS"
2.1.2 Knoppie [2.1.2 – Category selected]
SELECT DeviceName, Category, NumInStock
FROM tblDevices
WHERE Category LIKE "%' + sDeviceType + '"'
Alternatief: 3
WHERE Category LIKE "Smart ' + sDevicetype '"'
WHERE Category = "Smart ' + sDevicetype '"'
NOTE:
Aanvaar ook QuotedStr
2.1.3 Knoppie [2.1.3 – Online support]
SELECT DeviceName, Category, OperatingSystem
FROM tblDevices D, tblManufacturers M
WHERE D.ManufacturerID = M.ManufacturerID 6
AND OnlineSupport = True
ORDER BY DeviceName
2.1.4 Knoppie [2.1.4 – Profit per manufacturer]
SELECT ManufacturerID,
FORMAT(SUM (NumInStock * Price * 0.6) ,
"CURRENCY") 6
AS Profit
FROM tblDevices
GROUP BY ManufacturerID
2.1.5 Knoppie [2.1.5 - Remove devices]
Delete FROM tblDevices
4
WHERE Category = "Smart speaker" AND
ManufacturerID = "M104"
Subtotaal: 22
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 6 DBE/2023
SS/NSS – Nasienriglyne
VRAAG 2: NASIENRUBRIEK – VERVOLG
2.2 Databasismanipulering deur Delphi-kode te gebruik
2.2.1 Knoppie [2.2.1 – Display products]
Gaan na die eerste rekord in die tabel tblManufacturers
Gebruik 'n lus om deur tblManufacturers te stap
Vertoon ManufacturerName en ContactNumber
Vertoon DeviceName, Instock en Price as opskrifte
Gaan na die eerste rekord in die tabel tblDevices
Gebruik 'n lus om deur die tabel tblDevices te stap
Toets of (tblManufacturers ['ManufacturerID'] =
12
tblDevices['ManufacturerID'])
Vertoon DeviceName, NumInStock, omgeskakel na
'n string, en Price, omgeskakel na string ,
in redQ2_2_1
tblDevices.Next
Eindig lus (tblDevices)
tblManufacturers.Next
Eindig lus (tblManufacturers)
2.2.2 Knoppie [2.2.2 – Update stock]
Verkry iGetalVerkoop van input dialog box
en skakel na integer
Toets of tblDevices['NumInStock'] >= iGetalVerkoop
tblDevices.Edit
tblDevices['NumInStock'] =
tblDevices['NumInStock'] – iGetalVerkoop
tblDevices.Post 6
anders
ShowMessage "Not enough items in stock."
NOTA:
Edit en Post hoef nie binne die toets te wees nie.
Enige ander vorm van navigaise tussen rekords kan gebruik
work ipv Post.
Subtotaal: 18
TOTAAL AFDELING B: 40
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 7 DBE/2023
SS/NSS – Nasienriglyne
BYLAAG C
VRAAG 3: NASIENRUBRIEK - OBJEK-GEÖRIENTEERDE PROGRAMMERING
SENTRUMNOMMER: EKSAMENNOMMER:
MAKS. LEERDER-
VRAAG BESKRYWING
PUNTE PUNT
3.1.1 Konstruktor Create:
Opskrif met 3 parameterwaardes en regte data tipes
Ken korrekte parameters toe aan fSwitchID , fDevice 5
en fPowerUsage
Ken False aan fSwitchStatus toe
3.1.2 getSwitchID-funksie met 'n string terugstuurtipe
2
Result := fSwitchID
3.1.3 energyUsed-funksie met reële terugstuurtipe
Funksie-opskrif met korrekte terugstuurtipe en korrekte
parameter 4
Result = fPowerUsage * parameter waarde / 1000
3.1.4 setSwitchStatus-prosedure:
Regte opskrif met Boolean parameter 3
Ken parameterwaarde toe aan die fSwitchStatus-attribuut
3.1.5 toString-funksie net string terugstuurtipe
Result met regte byskrifte en regte name van attribute
4
Roep die determineSwitchStatus-metode
Regte formattering
Subtotaal: Objekklas 18
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 8 DBE/2023
SS/NSS – Nasienriglyne
VRAAG 3: NASIENRUBRIEK (VERVOLG)
MAKS. LEERDER
VRAAG BESKRYWING
PUNTE - PUNT
3.2.1 Button [3.2.1 – Instantiate object]
Verkry sSwitchID uit die comboBox
Verkry die toestel wat gekies is uit die listbox:
sReel := lstQ3_2_1.Items[lstQ3_2_1.ItemIndex]
Verkry die toestel en kraggebruik uit sReel:
8
sToestel := Copy(sReel, 1, pos('#', sReel) – 1)
iWatt := strToInt(Copy(sReel,pos('#', sReel) + 1))
Instansieer die objek met waardes wat verkry is:
objSmartSwitch := TSmartSwitch.create
(sSwitchID, sToestel,iWatt)
Roep objSmartSwitch.toString om te vertoon in rich edit
3.2.2 Knoppie [3.2.2 – Change switch status]
Gebruik ItemIndex van die radio group met if of case
Om die objSmartSwitch.setSwitchStatus metode te roep
Met korrekte Waar of Vals argumente 5
Vertoon die metodes objSmartSwitch.getSwitchID en
objSmartSwitch.determineSwitchStatus in die rich edit.
3.2.3 Knoppie [3.2.3 – Write to file]
AssignFile(tFile, 'log.txt') en Append(tFile)
Writeln(tFile,
DateToStr(Date) + ',' + lblTime.Caption + ',' 6
+ objSmartSwitch.getSwitchID+'#'
+ objSmartSwitch.determineSwitchStatus)
Maak lêer toe
NOTA: Aanvaar ook TimeToStr(Time) ipv lblTime
3.2.4 Knoppie [3.2.4 – Power usage]
Verkry ure uit edtQ3_2_4 en skakel om na integer
Roep die objSmartSwitch.energyUsed-metode met ure as 3
argument
Vertoon die energie wat gebruik is in die rich edit met regte
teks
Subtotaal: Vormklas 22
TOTAAL AFDELING C: 40
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 9 DBE/2023
SS/NSS – Nasienriglyne
BYLAAG D
VRAAG 4: NASIENRUBRIEK – PROBLEEMOPLOSSING
SENTRUMNOMMER: EKSAMENNOMMER:
MAKS. LEERDER
VRAAG BESKRYWING
PUNTE - PUNT
4.1 Knoppie [4.1 – Display]
Maak redQ4 skoon
Vertoon opskrif en nommers van kolomme
Lus iRow van 1 to 5
Instansieer afvoerstring met iRow 7
Korrekte geneste lus:
Lus iCol van 1 tot 6
Voeg item by skikking[iRow, iCol] by die afvoerstring
Vertoon afvoerstring in rich edit
4.2 Knoppie [4.2 – Add access point]
Verkry die iRow en iCol uit die spin edits
Inisialiseer teller
Lus iC van 1 tot 6
Toets of skikking by indeks [iRow, iC] = 'A'
Inkrementeer teller
10
Toets of teller 2 of minder is
Toets of karakter by indeks van skikking nie 'A' is nie
Voeg 'n 'A' in die regte indeks van skikking
Anders
Vertoon dat daar reeds 'n toegangspunt is
Anders
Vertoon boodskap dat daar reeds 3 toegangspunte is
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 10 DBE/2023
SS/NSS – Nasienriglyne
4.3 Knoppie [4.3 – Coverage]
Lus deur die rye iRow van 1 to 5
Lus deur kolomme iCol van 1 tot 6
As toegangspunt by die huidige indeks is
Lus van iRow – 1 na iRow + 1
Lus van iCol – 1 na iCol + 1
Toets of (ry IN [1..5]) EN (kolom IN [1..6])
As skikking[ry, kolom] = „_‟ (of NIE „A‟)
Stel skikking[ry, kolom] = „*‟
Vertoon skikking nadat sein bygevoeg is
Konsepte:
Find die toegangspunte: (3)
Bepaal die posisie (ry en kolom) van „n toegangspunt
Maak voorsiening vir al die omliggende elemente:
13
Lus (1) deur die ry indeks – 1 (1) na die ry indeks + 1 (1)
Geneste lus (1) deur die kolom indeks – 1 (1)
na die komom indeks + 1 (1)
Alternatief:
Vir indivuele gekodeer indeks kombinasies, trek 1 punt af vir elk
van die kombinasies wat vermis word met „n maksimum van 6
punte.
Toets en toeken:
Toets of die indekse nie verby die skikking grootte gaan nie (1)
Toets of die karakter by indeks „n „_‟ is (1)
Verander die indeks na „n „*‟ (1)
NOTA: Toets en toeken moet ten minste een keer korrek
gedoen word.
Vertoon die skikking nadat die sein bygevoeg is (1)
TOTAAL AFDELING D: 30
GROOTTOTAAL: 150
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 11 DBE/2023
SS/NSS – Nasienriglyne
OPSOMMING VAN LEERDER SE PUNTE:
SENTRUMNOMMER: LEERDER SE EKSAMENNOMMER:
AFDELING A AFDELING B AFDELING C AFDELING D
GROOT-
VRAAG 1 VRAAG 2 VRAAG 3 VRAAG 4
TOTAAL
MAKS.
40 40 40 30 150
PUNTE
LEERDER
SE PUNTE
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 12 DBE/2023
SS/NSS – Nasienriglyne
BYLAAG E: OPLOSSING VIR VRAAG 1
unit Question1_u;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, pngimage;
type
TfrmQuestion1 = class(TForm)
grpQ1_1: TGroupBox;
edtQ1_1: TEdit;
btnQ1_1: TButton;
grpQ1_2: TGroupBox;
btnQ1_2: TButton;
pnlQ1_2: TPanel;
grpQ1_5: TGroupBox;
edtQ1_5: TEdit;
redQ1_5: TRichEdit;
Label1: TLabel;
btn1_5: TButton;
grpQ1_3: TGroupBox;
grpQ1_4: TGroupBox;
Image1: TImage;
Label2: TLabel;
edtQ1_3: TEdit;
Label3: TLabel;
btnQ1_3: TButton;
pnlQ1_3: TPanel;
btnQ1_4: TButton;
redQ1_4: TRichEdit;
procedure btnQ1_1Click(Sender: TObject);
procedure btnQ1_2Click(Sender: TObject);
procedure btn1_5Click(Sender: TObject);
procedure btnQ1_3Click(Sender: TObject);
procedure btnQ1_4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmQuestion1: TfrmQuestion1;
implementation
{$R *.dfm}
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 13 DBE/2023
SS/NSS – Nasienriglyne
// =============================================================
// 1.1 Formatting 4 punte
// =============================================================
procedure TfrmQuestion1.btnQ1_1Click(Sender: TObject);
begin
edtQ1_1.Font.Size := 14;
edtQ1_1.Text := 'Hello world';
edtQ1_1.Font.Style := [fsUnderline];
edtQ1_1.Color := clGreen;
end;
// =============================================================
// 1.2 Random number 8 punte
// =============================================================
procedure TfrmQuestion1.btnQ1_2Click(Sender: TObject);
var
iRandom: integer;
begin
iRandom := Random(99) + 1;
if iRandom <= 9 then
pnlQ1_2.Caption := IntToStr(iRandom) + ' is a single digit value'
else
pnlQ1_2.Caption := IntToStr(iRandom) + ' is a two digit value';
end;
// =============================================================
// 1.3 Area 8 punte
// =============================================================
procedure TfrmQuestion1.btnQ1_3Click(Sender: TObject);
var
d, rArea: real;
const
pi: real = 22 / 7;
begin
d := StrToFloat(edtQ1_3.Text);
rArea := (3 * sqrt(3) / 2) * sqr(d) - pi * sqr(d / 2);
pnlQ1_3.Caption := FloatToStrF(rArea, ffFixed, 7, 1) + ' cm squared';
end;
// =============================================================
// 1.4 Find 11 punte
// =============================================================
procedure TfrmQuestion1.btn1_4Click(Sender: TObject);
var
tFile: textfile;
sLine, sWord: String;
iCount: integer;
begin
redQ1_4.Clear;
AssignFile(tFile, 'Words.txt');
Reset(tFile);
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 14 DBE/2023
SS/NSS – Nasienriglyne
sWord := (edtQ1_4.Text);
iCount := 0;
while NOT EOF(tFile) do
begin
Readln(tFile, sLine);
if UpperCase(sWord) = UpperCase(sLine) then
begin
inc(iCount);
end;
end;
if iCount > 0 then
begin
redQ1_4.Lines.Add('Occurrences: ' + IntToStr(iCount));
end
else
begin
redQ1_4.Lines.Add('Word not found');
end;
CloseFile(tFile);
end;
// =============================================================
// 1.5 Booster rocket 9 punte
// =============================================================
procedure TfrmQuestion1.btnQ1_5Click(Sender: TObject);
var
rTotalFuel, rFuel: real;
iCounter: integer;
begin
// Provided code
redQ1_5.Paragraph.TabCount := 3;
redQ1_5.Paragraph.tab[0] := 1;
redQ1_5.Paragraph.tab[1] := 50;
redQ1_5.Paragraph.tab[2] := 150;
redQ1_5.Lines.Add('Second' + #9 + 'Fuel used' + #9 +'Fuel left ' );
//1.5 Booster rocket
rTotalFuel := StrToFloat(inputbox('Fuel', 'Total litres of fuel: ',
'550'));
iCounter := 0;
while rTotalFuel > 200 do
begin
inc(iCounter);
rFuel := rTotalFuel / 100 * 7.5;
rTotalFuel := rTotalFuel - rFuel;
redQ1_5.Lines.Add(IntToStr(iCounter)+ #9+
FloatToStrF(rFuel,FFFixed,5,2)+#9+
FloatToStrF(rTotalFuel,FFFixed,5,2));
end;
end;
end.
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 15 DBE/2023
SS/NSS – Nasienriglyne
BYLAAG F: OPLOSSING VIR VRAAG 2
//======================================================================
// 2.1 – Afdeling: SQL-stellings
//======================================================================
//======================================================================
// 2.1.1 iOS devices 3 punte
//======================================================================
sSQL1 := 'SELECT DeviceID, DeviceName FROM tblDevices ' +
'WHERE OperatingSystem = "iOS"';
//======================================================================
// 2.1.2 Category selected 3 punte
//======================================================================
sSQL2 := 'SELECT DeviceName, Category, NumInStock ' +
'FROM tblDevices ' +
'WHERE Category LIKE "%' + sDeviceType + '"';
//======================================================================
// 2.1.3 Online support 6 punte
//======================================================================
sSQL3 := 'SELECT DeviceName, Category, OperatingSystem ' +
'FROM tblDevices D, tblManufacturers M ' +
'WHERE D.ManufacturerID = M.ManufacturerID ' +
'AND OnlineSupport = True ' +
'ORDER BY DeviceName';
//======================================================================
// 2.1.4 Profit per manufacturer 6 punte
//======================================================================
sSQL4 := 'SELECT ManufacturerID, ' +
'FORMAT(SUM(NumInStock * (Price * 0.6)), "CURRENCY") ' +
'AS [Profit] ' +
'FROM tblDevices GROUP BY ManufacturerID';
// ========================================================================
// 2.1.5 Remove devices 4 punte
//=======================================================================
sSQL5 := 'Delete * FROM tblDevices ' +
'WHERE Category = "Smart speaker" ' +
'AND ManufacturerID = "M104"';
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 16 DBE/2023
SS/NSS – Nasienriglyne
//======================================================================
// 2.2 – Afdeling: Delphi-kode
//======================================================================
//======================================================================
// 2.2.1 Display products 12 punte
// =====================================================================
procedure TfrmQuestion2.btnQ2_2_1Click(Sender: TObject);
begin
// Provided code
redQ2_2_1.Clear;
// Question 2.2.1
tblManufacturers.First;
while NOT tblManufacturers.Eof do
begin
redQ2_2_1.Lines.Add(tblManufacturers['ManufacturerName'] + ': ' +
tblManufacturers['ContactNumber']);
redQ2_2_1.Lines.Add(#9 + 'Device name' + #9 + 'In stock' + #9 +
'Price');
tblDevices.First;
while NOT tblDevices.Eof do
begin
if (tblDevices['ManufacturerID'] =
tblManufacturers['ManufacturerID']) then
begin
redQ2_2_1.Lines.Add(#9 + tblDevices['DeviceName'] + #9
+ IntToStr(tblDevices['NumInStock']) +
#9 +
FloatToStrF(tblDevices['Price'],
ffCurrency, 8, 2));
end;
tblDevices.Next;
end;
redQ2_2_1.Lines.Add('');
tblManufacturers.Next;
end;
end;
// =====================================================================
// 2.2.2 Update stock 6 punte
// =====================================================================
procedure TfrmQuestion2.btnQ2_2_2Click(Sender: TObject);
var
iNumSold: integer;
begin
// Question 2.2.2
iNumSold := StrToInt(InputBox('Products sold', 'Amount:', '50'));
if tblDevices['NumInStock'] - iNumSold > 0 then
begin
tblDevices.Edit;
tblDevices['NumInStock'] := tblDevices['NumInStock'] - iNumSold;
tblDevices.Post;
end
else
ShowMessage('Not enough items in stock.');
end;
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 17 DBE/2023
SS/NSS – Nasienriglyne
// =====================================================
// {$ENDREGION}
// =====================================================
// {$REGION 'Provided code: Setup DB connections - DO NOT CHANGE!'}
// =====================================================
procedure TfrmQuestion2.FormClose(Sender: TObject; var Action:
TCloseAction);
begin
// Disconnects from database and closes all open connections
dbCONN.dbDisconnect;
end;
procedure TfrmQuestion2.FormCreate(Sender: TObject);
begin
// Provided code
redQ2_2_1.Paragraph.TabCount := 2;
redQ2_2_1.Paragraph.Tab[0] := 100;
redQ2_2_1.Paragraph.Tab[1] := 150;
redQ2_2_1.Paragraph.Tab[2] := 200;
end;
procedure TfrmQuestion2.FormShow(Sender: TObject);
begin
// Sets up the connection to database and opens the tables.
dbCONN := TConnection.Create;
dbCONN.dbConnect;
tblManufacturers := dbCONN.tblOne;
tblProducts := dbCONN.tblMany;
dbCONN.setupGrids(dbgManufacturers, dbgProducts, dbgrdSQL);
pgcDBAdmin.ActivePageIndex := 0;
end;
// =====================================================
// {$ENDREGION}
end.
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 18 DBE/2023
SS/NSS – Nasienriglyne
BYLAAG G: OPLOSSING VIR VRAAG 3
Objekklas:
// =====================================================================
// 3.1.1 Constructor 5 punte
// =====================================================================
constructor TSmartSwitch.create(sSwitchID: String; sDevice: String;
iPowerUsage: Integer);
begin
fSwitchID := sSwitchID;
fDevice:=sDevice;
fPowerUsage := iPowerUsage;
fSwitchStatus := False;
end;
// =====================================================================
// 3.1.2 getSwitchID 2 punte
// =====================================================================
function TSmartSwitch.getSwitchID: String;
begin
Result := fSwitchID;
end;
// =====================================================================
// 3.1.3 energyUsed 4 punte
// =====================================================================
function TSmartSwitch.energyUsed(iHours: Integer): Real;
begin
Result := fPowerUsage * iHours / 1000;
end;
// =====================================================================
// 3.1.4 setSwitchStatus 3 punte
// =====================================================================
procedure TSmartSwitch.setSwitchStatus(bStatus: Boolean);
begin
fSwitchStatus := bStatus;
end;
// =====================================================================
// 3.1.5 toString 4 punte
// =====================================================================
function TSmartSwitch.toString: String;
begin
Result := 'Switch ID: ' + fSwitchID + #13 +
'Device: ' + fDevice + #13 +
'Power usage: ' + intToStr(fPowerUsage) + ' W' + #13 +
'Switch status:' + determineSwitchStatus;
end;
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 19 DBE/2023
SS/NSS – Nasienriglyne
// =====================================================================
// Kode wat voorsien is
// =====================================================================
function TSwitch.determineSwitchStatus: String;
var
sStatus: String;
begin
case fSwitchStatus of
True:sStatus := 'ON';
False: sStatus := 'OFF';
end;
Result := sStatus;
end;
//======================================================================
// Einde van kode wat voorsien is
// =====================================================================
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 20 DBE/2023
SS/NSS – Nasienriglyne
Hoofvormeenheid:
unit Question3_u;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs,SmartSwitch_u, StdCtrls, ComCtrls, Spin, ExtCtrls;
type
TfrmQuestion3 = class(TForm)
redQ3: TRichEdit;
btnQ3_2_1: TButton;
Panel1: TPanel;
btnQ3_2_2: TButton;
GroupBox3: TGroupBox;
Label3: TLabel;
GroupBox2: TGroupBox;
rgpQ3_2_2: TRadioGroup;
Panel2: TPanel;
GroupBox1: TGroupBox;
lstQ3_2_1: TListBox;
btnQ3_2_4: TButton;
cmbQ3_2_1: TComboBox;
Label1: TLabel;
edtQ3_2_4: TEdit;
Label2: TLabel;
GroupBox4: TGroupBox;
btnQ3_2_3: TButton;
lblTime: TLabel;
procedure btnQ3_2_1Click(Sender: TObject);
procedure btnQ3_2_2Click(Sender: TObject);
procedure btnQ3_2_4Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmQuestion3: TfrmQuestion3;
objSmartSwitch:TSmartSwitch;
implementation
{$R *.dfm}
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 21 DBE/2023
SS/NSS – Nasienriglyne
// =====================================================================
// 3.2.1 Instantiate object 8 punte
// =====================================================================
procedure TfrmQuestion3.btnQ3_2_1Click(Sender: TObject);
var
sSwitchID, sLine, sDevice:String;
iWatt:Integer;
begin
redQ3.Clear;
sSwitchID := cmbQ3_2_1.Text;
sLine := lstQ3_2_1.Items[lstQ3_2_1.ItemIndex];
sDevice := Copy(sLine, 1, pos('#',sLine) - 1);
iWatt := strToInt(Copy(sLine,pos('#',sLine)+1));
objSmartSwitch := TSmartSwitch.create(sSwitchID,sDevice,iWatt);
redQ3.Lines.Add(objSmartSwitch.toString);
end;
// =====================================================================
// 3.2.2 Change switch status 5 punte
// =====================================================================
procedure TfrmQuestion3.btnQ3_2_2Click(Sender: TObject);
begin
redQ3.Lines.Clear;
case rgpQ3_2_2.ItemIndex of
0: objSmartSwitch.setSwitchStatus(True);
1: objSmartSwitch.setSwitchStatus(False);
end;
redQ3.Lines.Add(objSmartSwitch.getSwitchID + ': ' +
objSmartSwitch.determineSwitchStatus);
end;
// =====================================================================
// 3.2.3 Write to file 6 punte
// =====================================================================
procedure TfrmQuestion3.Button1Click(Sender: TObject);
var
tFile : textFile;
begin
AssignFile(tFile, 'log.txt');
Append(tFile);
writeln(tFile,DateToStr(now)+'#'+lblTime.Caption+'#'+objSmartSwitch.getSwit
chID+'#'+ objSmartSwitch.determineSwitchStatus);
CloseFile(tFile);
end;
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 22 DBE/2023
SS/NSS – Nasienriglyne
// =====================================================================
// 3.2.4 Power usage 3 punte
// =====================================================================
procedure TfrmQuestion3.btnQ3_2_4Click(Sender: TObject);
var
iHours : Integer;
rEnergy: Real;
begin
redQ3.Lines.Clear;
iHours := StrToInt(edtQ3_2_4.Text);
rEnergy := objSmartSwitch.energyUsed(iHours);
redQ3.Lines.Add('Energy used is: '+ FloatToStr(rEnergy) +' kWh');
end;
end.
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 23 DBE/2023
SS/NSS – Nasienriglyne
BYLAAG H: OPLOSSING VIR VRAAG 4
unit Question4_u;
interface
uses
Windows, Messages, SysUtils, Variants,
Classes, Graphics,
Controls, Forms, Dialogs, StdCtrls, ComCtrls,
ExtCtrls, Buttons, Spin, pngimage;
type
TfrmQuestion4 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
btnQ4_1: TButton;
redQ4: TRichEdit;
btnQ4_2: TButton;
btnQ4_3: TButton;
gbxQ4_3: TGroupBox;
sedQ4_2_Row: TSpinEdit;
sedQ4_3_Col: TSpinEdit;
Label1: TLabel;
Label2: TLabel;
gbxQ4_1: TGroupBox;
gbxQ4_2: TGroupBox;
Image1: TImage;
procedure btnQ4_1Click(Sender: TObject);
procedure btnQ4_2Click(Sender: TObject);
procedure btnQ4_3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TfrmQuestion4;
arrNetwork: array [1 .. 5, 1 .. 6] of char =
(('_', 'A', '_', '_', '_', '_'), ('_', '_', '_', '_', '_', '_'),
('_', '_', '_', '_', 'A', '_'), ('_', '_', '_', '_', '_', '_'),
('_', 'A', '_', '_', '_', '_'));
implementation
{$R *.dfm}
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 24 DBE/2023
SS/NSS – Nasienriglyne
// =====================================================================
// 4.1 Display 7 punte
// =====================================================================
procedure TfrmQuestion4.btnQ4_1Click(Sender: TObject);
var
I: Integer;
J: Integer;
sLine: String;
begin
redQ4.Clear;
redQ4.Lines.Add('Access points');
sLine := ' 1 2 3 4 5 6' + #13;
for I := 1 to Length(arrNetwork) do
begin
sLine := sLine + intToStr(I) + ' ';
for J := 1 to Length(arrNetwork[I]) do
begin
sLine := sLine + arrNetwork[I, J] + ' ';
end;
sLine := sLine + #13;
end;
redQ4.Lines.Add(sLine);
end;
// =====================================================================
// 4.2 Add access point 10 punte
// =====================================================================
procedure TfrmQuestion4.btnQ4_2Click(Sender: TObject);
var
I, iCounter, iRow, iCol: Integer;
begin
redQ4.Clear;
iRow := sedQ4_2_Row.Value;
iCol := sedQ4_3_Col.Value;
iCounter := 0;
for I := 1 to Length(arrNetwork[iRow]) do
begin
if arrNetwork[iRow, I] = 'A' then
inc(iCounter);
end;
if iCounter < 3 then
begin
if arrNetwork[iRow, iCol] <> 'A' then
begin
arrNetwork[iRow, iCol] := 'A';
end
else
begin
ShowMessage('Access point already on this location.');
end;
Kopiereg voorbehou Blaai om asseblief
Downloaded from hlayiso.com
Inligtingstegnologie/V1 25 DBE/2023
SS/NSS – Nasienriglyne
end
else
begin
ShowMessage('There are already 3 access points in the row.');
end;
btnQ4_1.Click;
end;
// =====================================================================
// 4.3 Coverage 13 punte
// =====================================================================
procedure TfrmQuestion4.btnQ4_3Click(Sender: TObject);
var
I: Integer;
J: Integer;
K: Integer;
L: Integer;
begin
for I := 1 to Length(arrNetwork) do
begin
for J := 1 to Length(arrNetwork[I]) do
begin
if arrNetwork[I, J] = 'A' then
begin
for K := J - 1 to J + 1 do
begin
for L := I - 1 to I + 1 do
begin
if (K in [1..5]) AND (L in [1..6]) then
begin
if arrNetwork[L, K] = '_' then
begin
arrNetwork[L, K] := '*';
end;
end;
end;
end;
end;
end;
end;
btnQ4_1.Click;
end;
end.
Kopiereg voorbehou
Study this subject
Recommended for this subject

Memorandum
Information Technology Grade 12 P1 NSC June 2023 Memo (Eng)

Question paper
Information Technology Grade 12 P1 NSC June 2023 QP (Eng)

Memorandum
Information Technology Grade 12 P1 NSC June 2019 Memo (Afr)

Memorandum
Information Technology Grade 12 P1 NSC June 2018 Memo (Eng)

Question paper
Information Technology Grade 12 P1 NSC November 2023 QP

Question paper
Information Technology Grade 12 P1 NSC June 2019 QP (Afr)
More from Grade 12 Information Technology

Question paper
Information Technology Grade 12 P2 Eastern Cape Mock 2025 QP

Question paper
Information Technology Grade 12 P2 2024 QP (Afr)

Question paper
Information Technology Grade 12 P2 2024 QP (Eng)

Question paper
Information Technology Grade 12 P1 November 2024 NSC QP

Question paper
Information Technology Grade 12 P2 November 2024 NSC QP

Memorandum