INFORMATION TECHNOLOGY PAPER 1
GRADE 12
NOVEMBER 2019
NATIONAL SENIOR CERTIFICATE
INSTRUCTIONS AND INFORMATION
NOTE: Candidates must use the file DataENGNov2019.exe.
Do the following:
Once extracted, the following list of files will be available in the folder DataENGNov2019:
SUPPLIED FILES
Question 1:
Question1_P.dpr
Question1_P.dproj
Question1_P.res
Question1_U.dfm
Question1_U.pas
Question 2:
ConnectDB_U.dcu
ConnectDB_U.pas
HockeyDB.mdb
Question2_P.dpr
Question2_P.dproj
Question2_P.res
Question2_U.dfm
Question2_U.pas
Question 3:
Player_U.pas
Question3_P.dpr
Question3_P.dproj
Question3_P.res
Question3_U.dfm
Question3_U.pas
Question 4:
Maze 1.txt
Maze 2.txt
Maze 3.txt
Question4_P.dpr
Question4_P.dproj
Question4_P.res
Question4_U.dfm
Question4_U.pas
SECTION A
QUESTION 1: GENERAL PROGRAMMING SKILLS
Do the following:
1.1 Button [1.1 - Display amount due] Mini pizzas can be ordered from the tuck shop at a school at R14,95 each. Write code to do the following:
1.2 Button [1.2 - Pythagoras]
In Mathematics, the Pythagorean theorem is a fundamental relation in Euclidean geometry with regard to the three sides of a right-angled triangle.
Write code to do the following:
The formula C2 = A2 + B2 is used to determine the length of the side opposite the right angle in the triangle below.
1.3 Button [1.3 - Determine lowest number] A global variable, iLowest, is declared and initialised to the value 100. Write code to do the following when the Determine lowest number button is clicked:
NOTE:
Example of output when the button is clicked once and the random number 42 is generated:
Example of output when the button is clicked six times:
NOTE: The output displayed by your program may differ from the example output, as random numbers are generated. (9)
1.4 Button [1.4 - Display decrypted string] An encrypted string entered by the user must be decrypted and displayed. The encrypted string contains digits, as some of the alphabetical characters in the string have been replaced with digits according to the table below.
ALPHABETICAL CHARACTER | REPLACEMENT DIGIT |
A | 0 |
B | 1 |
C | 2 |
D | 3 |
E | 4 |
F | 5 |
G | 6 |
H | 7 |
I | 8 |
J | 9 |
Example:
Encrypted version of the string: T8M4!
Original string (decrypted): TIME!
Write code to do the following to decrypt an encrypted string:
Example of input if T8M4! was entered as an encrypted string:
Output for the encrypted string T8M4!:
Test your code using the following test data:
90R represents JAR
03V4NTUR4 T8M4! represents ADVENTURE TIME!
039024NT represents ADJACENT (13)
TOTAL SECTION A: 40
SECTION B
QUESTION 2: DATABASE PROGRAMMING
The hockey organiser at your school requires your assistance with the administration of the players, teams and coaches. The database HockeyDB contains two tables called tblPlayers and tblTeams.
The data pages attached at the end of this question paper provide information on the design of the database and the content of the tables.
Do the following:
NOTE:
Variable | Data type | Description |
tblTeams | TADOTable | Refers to the table tblTeams in the database HockeyDB |
tblPlayers | TADOTable | Refers to the table tblPlayers in the database HockeyDB |
2.1 Tab sheet [Question 2.1 - SQL]
Example of the GUI for QUESTION 2.1:
NOTE:
Complete the SQL statements to perform the tasks described in QUESTION 2.1.1 to QUESTION 2.1.5 that follow.
2.1.1 Button [2.1.1 - Best players]
Display the surnames and names of all players with a skills level of 10.
Example of output of the first four records: (3)
2.1.2 Button [2.1.2 - B-team coaches]
Display the names of the coaches and teams of all the B-teams.
Example of output: (4)
2.1.3 Button [2.1.3 - Percentage games won]
Code has been provided to extract a team name from the combo box, cmbQ2_1_3.
Display the name of the team, their coach and the percentage of games won by the team. Save the percentage of games won in a calculated field called PercentageGamesWon.
Example of output if the u/14 B team was selected:
NOTE: You do NOT have to format the calculated value. (4)
2.1.4 Button [2.1.4 - Team average more than 6]
The average skills levels of teams are used to identify teams with the highest possibility of winning their games.
Display the names and average skills levels of all teams with an average skills level of more than 6. The average skills level per team must be saved in a calculated field called AverageSkillsLevel, formatted to ONE decimal place.
Example of output: (5)
2.1.5 Button [2.1.5 - Update games won]
The results of the games won during the last sports day must be used to update the NumberOfGamesWon field. Only the u/14 B team lost their game.
Update the data in the tblTeams table by adding a value of 1 to the NumberOfGamesWon field for the teams who won their game.
Example of output: (3)
2.2 Tab sheet [Question 2.2 - Delphi code]
Example of GUI for QUESTION 2.2:
NOTE:
2.2.1 Button [2.2.1 - Junior players in u/18 A team]
The u/18 A team includes some of the junior players that are exceptionally talented. Junior players are players that were born after the year 2002.
NOTE: The first two digits of the IDNumber field indicate the year of birth of a player.
Write code to do the following:
Example of content of the Junior18A text file:
Example of output to be displayed on the lblQ2_2_1 label: (11)
2.2.2 Button [2.2.2 - Coach and goalkeeper information]
The coach and goalkeeper of all the teams are invited to a special training session.
Code has been provided to set the various column widths and to display the headings, as shown in the example of output.
Write code to display a list containing the following information on each team:
Example of output of the first five records: (10)
TOTAL SECTION B:40
SECTION C QUESTION 3: OBJECT-ORIENTATED PROGRAMMING
The school is designing software to calculate the body mass index (BMI) of the rugby players and to determine the eligibility of the rugby players for selection.
Do the following:
Example of the GUI:
3.1 The incomplete object class (TPlayer) provided contains the declarations of three attributes that define a Player object.
The attributes for the Player object have been declared as follows:
Names of attributes
Description
fPlayerName
The first name of the rugby player
fWeightOfPlayer
The weight of the player
fScore
The score achieved at a specific rugby game
3.1.1 Write code for a constructor method that will receive the player's name and weight as parameter values. Assign these values to the respective attributes. Set the score attribute to the value of zero. (4)
3.1.2 Write code for an accessor method called getScore for the fScore attribute. (2)
3.1.3 Write code for a method called updateScore that will receive an integer value as a parameter and add the received value to the fScore attribute. (3)
3.1.4 Write code for a method called calculateBMI that must receive the height of the player as a parameter and calculate and return the player's BMI based on the following formula:
BMI = weight of player/(height of player)2 (3)
3.1.5 Write code for a method called eligibleForSelection that can be used to determine the possibility for selection to play at the Provincial Trials Tournament. Possible selection is determined by evaluating the content of fScore attribute according to the following categories:
The method must return the relevant message
Score | Message |
0 to 7 points | Low possibility |
8 to 14 points | Medium possibility |
More than 14 points | High possibility |
(4)
3.1.6 Write code for a toString method to display the attributes of the player object in the following format:
Name: <fPlayerName>
Weight: <fWeightOfPlayer>
Current score: <fScore>
Example:
Name: Olaff
Weight: 70.3
Current score: 0 (4)
3.2 An incomplete unit Question3_U has been provided and contains code for the object class to be accessible.
The following global variable has been declared:
The object objPlayer
Do the following to complete the code for QUESTION 3.2.1 to QUESTION 3.2.4 in the main form unit:
3.2.1 Button [3.2.1 - Instantiate object]
Write code to do the following:
3.2.2 Button [3.2.2 - Calculate BMI]
The redQ3_2_2 component must be used as the display area.
Write code to do the following:
Example of output if the weight of the player is 70,3 kg and the height of the player is 1,80 m: (7)
3.2.3 Button [3.2.3 - Update score]
The score of a player is updated as the game progresses.
The user must select a score in the radio group called rgpQ3_2_3 and click the Update score button each time the player scores points during the game.
Write code to do the following:
Example of output if the value of 2 was selected as the first score and the Update score button was clicked:
Example of output if the value of 5 was selected as the next score and the Update score button was clicked: (6)
3.2.4 Button [3.2.4 - Eligible for selection]
Write code to call the method that returns a message indicating the player's eligibility for selection. Display the message in the label lblQ3_2_4.
Example of output if the current score of the player is 8:
Example of output if the current score of the player is 15: (2)
TOTAL SECTION C: 40
SECTION D
QUESTION 4: PROBLEM-SOLVING PROGRAMMING
SCENARIO
A school uses a maze as a team-building activity for the rugby and netball first teams.
Do the following:
Example of the GUI:
The following code has been provided:
The maze is represented using various characters as follows:
Complete the code for EACH section of QUESTION 4, as described in QUESTION 4.1 and QUESTION 4.2 that follow.
4.1 Button [4.1 - Display maze]
A combo box called cmbQ4_1 has been populated with the names of the three mazes, namely Maze 1, Maze 2 and Maze 3. Three text files called Maze 1.txt, Maze 2.txt and Maze 3.txt are provided. Each text file contains lines of characters that represent the layout of each maze respectively.
The user must select a maze from combo box cmbQ4_1.
Code has been provided to clear the component called redQ4.
Write code to do the following:
Example of output if Maze 1 was selected from the combo box:
Example of output if Maze 2 was selected from the combo box: (11)
4.2 Button [4.2 - Longest corridor]
The longest corridor refers to the maximum number of consecutive horizontal open spaces in a row in the maze. An open space is represented by the dash ('-') character.
Write code to do the following:
Example of output for Maze 1:
Example of the output for Maze 3: (19)
TOTAL SECTION D:30
GRAND TOTAL: 150
INFORMATION TECHNOLOGY P1
DATABASE INFORMATION OF HockeyDB FOR QUESTION 2:
The design of the database tables is as follows:
Table: tblTeams
This table contains the data of all the hockey coaches.
Field name | Data type | Description |
TeamName (PK) | Text (10) | A unique team name. A team name is saved in the format 'u/18 A', where A indicates an A-team, B indicates a B-team and so on. The number 18 is the age group of the team players. |
Coach | Text (25) | The surname and initials of the team's coach |
NumberOfGamesPlayed | Integer | The total number of games the team played this season |
NumberOfGamesWon | Integer | The total number of games the team won this season |
Example of the first four records of the tblTeams table:
Table: tblPlayers
This table contains the data of the hockey players of three different age groups:
Field name | Data type | Description |
PlayerID (PK) | Autonumber | A unique number assigned to the player |
PlayerSurname | Text (25) | The surname of the player |
PlayerName | Text (25) | The name of the player |
IDNumber | Text (20) | The South African ID number – first 6 digits is the person's date of birth in the format yymmdd. |
TeamName | Text (10) | The team name that the player is a member of, e.g. 'u/18 A' |
SkillsLevel | Integer | A value in the range 1 to 10 indicating the player's skills level. A value of 1 indicates a low skills level. |
GoalKeeper | Boolean | A value of 10 indicates a high skills level. A value indicating whether the player is a goalkeeper (true) or not (false) |
Example of the first four records of the tblPlayers table:
NOTE:
The following one-to-many relationship with referential integrity exists between the two tables in the database: