0% found this document useful (0 votes)
59 views9 pages

Grade 10 IEB 2022 Final Practical (Paper 1)

Uploaded by

eruclad
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)
59 views9 pages

Grade 10 IEB 2022 Final Practical (Paper 1)

Uploaded by

eruclad
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
You are on page 1/ 9

FINAL EXAMINATION 2022

GRADE 10 IEB

INFORMATION TECHNOLOGY PAPER 1

Examiner: A Lewis Date: 17 November 2022

S Van Wyk

Moderator: L Rix Time: 2.5 Hours

S De Lange

Marks: 100

Name and Surname:

Educator: School:

PER QUESTION ANALYSIS

QUESTION MARKS MARK ACHIEVED

1 30

2 70

TOTAL 100 %

This paper consists of 2 questions and 9 pages including this page.

Page 1 of 9
PLEASE READ THE FOLLOWING INSTRUCTIONS CAREFULLY

1. This question paper consists of 9 pages. Please check that your question paper is
complete.
2. Make sure that you answer the questions in the manner described because marks will
be awarded for your solution according to the specifications that are given in the
question.
3. If you cannot get a section of code to work, comment it out so that it will not be executed
and so that you can continue with the examination.
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. You must save all your work regularly on the disk space allocated to you for this
examination.
6. If your examination is interrupted by a technical problem such as a power failure, you
will, when you resume writing, be given only the time that was remaining when the
interruption began, to complete your examination. No extra time will be given to catch
up on work that was not saved.
7. Make sure that your NAME appears as a comment in every program that you code as
well as on every page of hard copy that you hand in.
8. Print a code listing of all the programs/classes that you code. Printing must be done
after the examination. You will be given time to print after the examination is finished.
Your teacher will tell you what arrangements have been made for the printing of your
work.
9. You should be provided with the following files. These files are to be used as data for
this examination.
• SQLAnswerSheet.rtf
• RoadRace.accdb OR RoadRace.mdb OR RoadRace.sql

Page 2 of 9
SECTION A SQL

QUESTION 1 30 MARKS

The organising committee of the South African Institute of Road Runners has a database called
RoadRace. This database contains a table called tblResults. This table is a complete record of
all the competitors that took part in the 2022 SAIRR National Finals Race, held recently in Cape
Town.

The design of the tblResults table is below:

The first 10 rows of the tblResults table are provided below as a sample:

Write SQL statements to do the following, and paste your answers into the supplied file called
SQLAnswerSheet.rtf:

Page 3 of 9
1.1 Display the details of all the athletes in descending order of how many races they have
completed. Any athletes that share the same number of previous races must be sorted
alphabetically on their surname.
Output for the first five records of a correct query:

(5)

1.2 There are three categories of athlete – Junior, Senior and Veteran. Display the race
number, first name, surname, and gender for all the Junior category athletes who are
representing Kwazulu-Natal.
Output for the first five records of a correct query:

(4)

1.3 Display the race number, first name, surname and finish time for all of the athletes who
have race numbers that begin with D2.
Full output for a correct query:

(2)

Page 4 of 9
1.4 The 10 athletes that finish in the fastest time all win gold medals. Display the details of
all the gold medal winners.
Full output for a correct query:

(3)

1.5 All athletes that finish from 5 hours to 7.5 hours win bronze medals. Display the details
of all female athletes in the veteran category that win the bronze medals. Show the list
in the order in which they finished, keeping athletes from the same province together.
Output for the first ten records of a correct query:

(6)

1.6 Currently, all international athletes have no province code. Write a query to change the
province code of all international athletes to ZZZ.
(3)

Page 5 of 9
1.7 The committee found the details for an athlete that was not stored in the database. Add
the following runner into the table :
Speedy Gonzales (race# F45364) is a veteran female runner from Kwazulu-Natal who
finished in 7 hours 19 minutes. This was her first race.
(4)

1.8 Runners that complete the race in more than 7.5 hours are classified as “Did Not
Finish”. Write a query that will delete all of athletes that did not qualify.
(3)

[30]

SECTION B JAVA PROGRAMMING

QUESTION 2 70 MARKS

The South African Institute of Road Runners has employed you to write them a Java application
to assist them in processing all of the entries for their upcoming South African Road Running
Championship Final.
You have not been given all of the actual data yet. So during the development cycle your program
will need to generate random times for all of the runner’s races. That way you can write and test
the program before you have been supplied the data files by the SAIRR committee.
The name of each runner is entered in via the keyboard.
All names are guaranteed to be a first name and a surname.

In order to qualify for the SA Finals race each athlete has to –


• run THREE qualification races (one each in Durban, Gauteng, and Cape Town).
• at least ONE of those races must be completed in 4 hours 20 mins, or less.

Page 6 of 9
2.1 Create a main class called Results. (1)
2.2 Create static variables to store the runner's name, average time, total number of
athletes, and total number of qualified athletes, using the table below:

Variable Name Type

name string

average int

totalAthletes int

totalQualified int

(4)
2.3 In the main method:
2.3.1 Add code to input the name of the first athlete, and assign it to the name
variable. This will always be a firstname and a surname. (2)
2.3.2 Use an appropriate loop to keep processing and entering an unknown number
of runner’s names, until the user enters "EXIT" in either upper or lowercase. (4)
2.4 Create a private static method called eachAthlete. This method will be called to
process the data for each individual runner. This method does not return anything. (1)
2.5 Add code in the EachAthlete method to:
2.5.1 Display the runner’s full name. Check the output at the end of the paper for
guidance on the required format. (2)
2.5.2 You have not been given the actual data of all the runners’ times yet. So you
will generate random finishing times for all of the races. Generate a random
number between 220 and 420 (inclusive), and assign it to a variable called
time. This will be the time in minutes. (4)
2.5.3 Each runner needs THREE separate times, one for each of the qualification
races. Add code to repeat the code in Q2.5.2 above THREE times. (3)
2.5.4 Inside of the loop you created in Q2.5.3 above, add code to assign the name of
the qualification race to a variable called race based on the loop control
variable. The names of the 3 races are DURBAN, GAUTENG, and
CAPETOWN. Use the most appropriate programming structure.
For example, if the loop control variable is 1 the race is "DURBAN" and if the
loop control variable is 2 the race is "GAUTENG", etc. (5)
2.5.5 Output the name of the race and the random number of seconds generated for
each runner. The line must begin with a TAB character. Check the output at the
end of the paper for guidance on format. (3)

Page 7 of 9
2.5.6 A runner needs at least ONE race time of 4 hours 20 mins (or less) to qualify.
Insert code to check each race time, and use a boolean variable called
qualified as a flag. (5)
2.5.7 Add code to calculate the average time for all 3 races. Assign the calculated
average to the static average variable. (3)
2.5.8 Add code to output the average time for each runner. Note that the time must
be output in hours and minutes. Check the output below for guidance on the
exact format. (3)
2.5.9 Add code to output if the athlete qualified to take part in the final race, or not.
Use the boolean flag that you coded in Q2.5.6 above. Check the output below
for guidance on the exact format. (3)
2.5.10 Add code to keep track of the total number of athletes that have qualified.
Assign this value to the static totalQualified variable. (1)
2.6 In the main method, add code to:
2.6.1 Call the eachAthlete method for each runner that gets entered in via the
keyboard. (1)
2.6.2 Write code to keep a count of how many athletes have been entered. Use the
static totalAthletes variable. (1)
2.6.3 The fastest runner is the one with the lowest average time for all 3 of their
qualification races. Write code to determine which runner is the fastest. (5)
2.6.4 Write code to output the total number of athletes that were entered, and also
how many have qualified. Check the output below for the exact format. (2)
2.6.5 Write code to change the format of the name of the fastest athlete. The output
must be a surname followed by the initial and a fullstop.
For example: Jane Doe will display as Doe J. (7)
2.6.6 Display the fastest athlete. The output contains a TAB character. Check the
output below for guidance on the exact format. (3)
2.6.7 Write code to calculate the average of all the athletes’ average times. Assign
this value to a variable called overallAverage, and round it to a maximum of 1
decimal place. (6)
2.6.8 Display the average time of all the athletes. See the output below for the correct
format. (1)

Page 8 of 9
SAMPLE OUTPUT (2 ATHLETES WERE ENTERED)

Joe Public
Ran DURBAN race in 308 minutes
Ran GAUTENG race in 338 minutes
Ran CAPETOWN race in 341 minutes
Average time: 5 hours 29 mins
DID NOT QUALIFY

Jane Doe
Ran DURBAN race in 392 minutes
Ran GAUTENG race in 305 minutes
Ran CAPETOWN race in 227 minutes
Average time: 5 hours 8 mins
QUALIFIED

1 out of 2 athletes qualified


Fastest athlete: Doe J.
Overall average time: 318.0 minutes

Page 9 of 9

You might also like