MEMORANDUM

NAME OF LEARNER: 

TOTAL  

QUESTION 1:

TOTAL  

QUESTION 2:

TOTAL  

QUESTION 3:

TOTAL  

QUESTION 4: 

TOTAL

/37

/41

/36

/36

/150

QUESTION 1: GENERAL PROGRAMMING SKILLS 

Max. 

MARKS

MARKS  

ACHIEVED

1.1 

1.1.1

BUTTON: [1.1 Join] 

Declaring string variables✔ and age as an integer variable✔ Get E-mail and password as string variables✔ 
Get Age✔ stored as integer 
Get the Grade✔

5

 

1.1.2 

Initialise counters for capitals and numbers✔ 
Loop for the length of the password✔ 
 If a character is a capital letter✔ 
 then increment the correct counter✔ 
 If a character is a number from 0 to 9✔ 
 then increment the correct counter✔ 
check if all conditions are true: ✔ 
If length of password >= 8✔ 
 and counter for capital letters >=1✔ 
 and counter for numbers >=2✔ 
 and age >= 16✔ 
 and grade >= 10✔ 
 and email contains ‘@’ symbol✔ 
then set pnlQuestion1_2 to enabled✔ 
else✔ 
 set pnlQuestion1_2 to disabled✔

16

 

1.2 

1.2.1

BUTTON: [1.2 Upload] 

Obtain the category name from the combobox ✔ Obtain the speed and the size, both converted to a number ✔

2

 

1.2.2 

If length of title > 23✔ 
 then clear the edit box edtTitle✔ 
 and exit ✔

3

 

1.2.3 

Calculate time to upload in seconds (size/speed) ✔ Test for a whole number (using frac and trunc or any other  successful method) ✔
If time to upload is not a whole number (not an integer)  Then round up to next whole number✔ 
Calculate minutes (time to upload in seconds / 60) ✔

4

 

1.2.4 

Compile the video code✔ using:  
 A random number from 10 to 100✔ last character of the title✔ 
length of the title✔

4

 

1.2.5 

Display the Title, Video code, Category and Minutes in the   richedit (redUploads) in correct order✔ 
 Minutes formatted to 1 decimal place ✔ 
 using spacing (#9) ✔

3

 
 

TOTAL QUESTION 1 

37

 

QUESTION 2: OBJECT-ORIENTATED PROGRAMMING 

Max. 

MARKS

MARKS  

ACHIEVED

2.1.1 

Constructor Create: 
Correct name✔ with string parameter✔ 
Set fvideoname to parameter value✔ 
Set flikes and fdislikes to 0✔

4

 

2.1.2 

Procedure AddNewComment 
Correct method - procedure✔ 
2 string parameters✔ 
Joined to attribute fcomments✔ 
 first empty line (#13)  
 Comment parameter added✔ 
 Tab space (#9)✔ 
 Date parameter added✔ 
 last empty line (#13)  
 Empty lines added (#13) in the correct places✔

7

 

2.1.3 

Procedure SetRating; 
Correct method – procedure ✔ 
Calculate the difference fLikes - fDislikes✔ Use case or nested IF statements✔ 
 Set attribute fRating to ✔ 
 2, if difference is 1 to 3✔ 
 5, if difference is > 3 ✔ 
 If frating <= 0 then frating = 0✔

7

 

2.1.4 

Function GetRating: string; 
correct method , a string function or a procedure with  a variable string parameter✔ 
Initialise a local variable to an empty string✔ Loop from 1 to the attribute value, frating✔  Join stars ( * symbol ) to local string variable✔   

 OR 

 If frating = 2 then star string = ‘**’ 
 If frating = 5 then star string = ‘*****” 
 If frating = 0 then star string = empty string  (3 marks) 
Return the local string variable✔

5

 
 

2.1 Subtotal: Object class 

23

 

2.2.1 

TQuestion2.lbxVideosClick 
Instantiate the object 
Object name = ✔ classname.create✔ with argument  name of video✔

3

 

2.2.2 

Button: [2.2.2 Like] and  
Call the addLike method with correct object name✔ Button: [2.2.2 Dislike] 
Call the addDislike method with correct object name✔

2

 

2.2.3 

Button: [2.2.3 Watch this video] 
Inputbox or messagedlg for Y or N response from user✔ 
If “Y” then bitbtnLike.click✔ 
 Else bitbtnDislike.click✔ 
Call the setrating procedure with correct object name✔ Call the getRating function with correct object name✔  and display in the panel pnlRatings✔

6

 

2.2.4 

Button: [2.2.4 Submit] 
Join the name and comment from the input components✔ Comment on a separate line✔ 
Call the AddNewComment method with correct object  name✔ 
with arguments : 
joined name and comment compiled into one string   and the SystemDate ✔ 
Clear the richedit ✔ 
Richedit component for display✔ Object name/ toString✔

7

 
 

2.2 Subtotal: Form class 

18

 
 

TOTAL QUESTION 2 

41

 

QUESTION 3: DATABASE PROGRAMMING 

MAX. 

MARKS

MARKS  

ACHIEVED

3.1.1 

Button: [3.1.1]

4

 

SQL: Select DateCreated, ProfileName from Profile order by  DateCreated DESC

Concepts: 
SELECT all correct fields✔ 
FROM correct table✔ 
ORDER BY correct field✔ DESC ✔

3.1.2 

Button: [3.1.2]

9

 

SQL: Select DatePublished, format((Likes - Dislikes +  Comments)/Views, "Currency",2) AS [Earnings] 
from Video, Profile  
where Video.ProfileID = Profile.ProfileID and ProfileName = ‘ +  QUOTEDSTR(SLINE)

Concepts: 
SELECT correct field (DatePublished) ✔ 
Calculation of 4 correct fields✔ format to currency✔ AS specified field name✔ 
FROM ✔ Video Profile (2 tables) ✔ 
WHERE clause to link tables✔ 
AND ✔correct condition and correct syntax✔

3.1.3 

Button: [3.1.3]

4

 

SQL: Select VideoTitle  
from Video  
where Views >= 1000 and Dislikes <= 10

Concepts: 
SELECT correct field✔ 
FROM correct table✔ 
WHERE Views >= 1000✔ 
AND Dislikes <=10✔

3.1.4 

Button: [3.1.4]

4

 

SQL: Delete  
from Video 
where YEAR(DatePublished) = 2008

Concepts: 
DELETE✔ 
FROM correct table✔ 
WHERE Year function✔ DatePublished = 2008✔

3.1.5 

Button: [3.1.5]

3

 

SQL: Update Profile  
set ProfileName = "Tim Horton"  
where ProfileName = "TimmyTom"

Concepts: 
UPDATE correct table✔ 
SET correct field = Tim Horton✔
WHERE correct field = TimmyTom✔

 

3.1 Subtotal: SQL 

24

 

3.2.1 

Button: [3.2.1] 
Move to first record of tblVideos ✔ 
Loop while not end of table✔ 
 If uppercase✔ VideoTitle field contains ‘THE’✔  Then display VideoTitle field in richedit✔  Move to next record before end of loop✔

6

 

3.2.2 

Button: [3.2.2] 
Move to first record of tblVideos ✔ 
Loop while not end of table✔ 
If Dislikes field >= 9✔ 
 Then delete✔ 
 Else✔ 
 Move to next record before end of loop✔

6

 
 

3.2 Subtotal: Code constructs 

12

 
 

TOTAL QUESTION 3

36

 

QUESTION 4: PROBLEM-SOLVING 

MAX. 

MARKS

MARKS  

ACHIEVED

4.1 

MENU OPTION [4.1 Sort and Remove] 
Outer loop from 1 to array count – 1✔ 
 Inner loop from outer loop counter to array count✔ 
If arrprofiles[outerloop] < arrprofiles[innerloop] ✔ 
Then Set temp veriable to arrprofiles[outerloop] ✔
  Set arrprofiles[outerloop] = arrprofiles[innerloop] ✔  
Set arrprofiles[innerloop] = temp variable✔
  perform the same swap alogrithm for arrminutes ✔ 
outer loop from 1 to 7 (1st 7 elements to remove) ✔
  inner loop from 1 to array count - 1✔ 
 replace element in arrprofiles with the next index✔
  replace element in arrminutes with the next index✔
subtract 7 from array counter after nested loops✔ 
Assignfile (text file name, profile name + ‘.txt’) ✔
Rewrite(text file name); ✔ 
Loop to array counter ✔ 
 Writeln✔(text file name, arrprofiles and arrminutes   converted to string) ✔ (closefile statement)

17

 

4.2 

MENU OPTION [4.3 Advertisements] 
Extract name from combo box✔ 
Using 2 nested loops✔ 
Set the 2D array contents to 0 ✔ 
 (subtract 1 mark if a procedure to reset the array  was not written) Set counter = 0✔ 
Loop from 1 to array counter✔ 
 If name = string in array arrprofiles (correct index)✔  then get minutes from arrminutes(correct index) ✔  increment counter✔ 
 Set space = minutes divided by 4✔ 
Use Case or nested If statements:✔ 
For 2 adverts: 
 Add space to 2D array at row=counter, column=1✔   set space = 3 x space✔ 
 Add space to 2D array at row=counter, column=3✔  For 4 adverts: 
 Set temp variable = space✔ 
 Loop from 1 to 4 ✔ (4 entries made to 2darray)  Add temp to 2D array at row=counter, column=   loop variable ✔   Set temp = temp + space✔ 
End of if statement in correct position✔ 
Call the procedure Display in the correct place✔

19

 
 

TOTAL QUESTION 4 

36

 

SAMPLE SOLUTIONS

1 HGVYGDA

10 JHAJGD

11 UYGAUY

12 UYGAYUGA

13 IBAIDHA

14 TYGAYTDG

15 UGBAYGUDBA

16 UBAYDA

17 UYHG UYC

18 IAHUYDYA

19 IHBSUIHS

20 IHNIHSA

21 UYGHAYHY

22 IHAUYHA

23 UGAUDGA

24 UGBAUYGBDS

Last modified on Thursday, 16 December 2021 06:39