INFORMATION TECHNOLOGY
PAPER 1
GRADE 12
NSC EXAM PAPERS AND MEMOS
NOVEMBER 2016
INSTRUCTIONS AND INFORMATION
NOTE:
Do the following:
DELPHI FILES JAVA (NETBEANS) FILES
Question1: Question1:
Question1_P.dpr Question1.form
Question1_P.res Question1.java
Question1_U.dfm
Question1_U.pas
Question2: Question2:
DataQ2.txt DataQ2.txt
Excursion_U.pas Excursion.java
Question2_P.dpr Question2.form
Question2_P.res Question2.java
Question2_U.dfm
Question2_U.pas
Question3: Question3:
Question3_P.dpr Question3.form
Question3_P.res Question3.java
Question3_U.dfm
Question3_U.pas
SCENARIO |
SECTION A
QUESTION 1: GENERAL PROGRAMMING SKILLS
The aquarium at Aqua Wonderland is setting up a new rectangular shark tank. The administrators need a software program to manage the income from visitors and the daily expenses of maintaining the tank. |
Do the following:
Example of graphical user interface (GUI):
Write code to obtain the length, width and height of the tank from the text boxes provided. Calculate and display the volume of the tank, using the following formula:
Volume = length x width x height
Example of output if the length is 16.5 metres, the width is 14.2 metres and the height is 12.5 metres:
(5)
1.2 Button [Question 1_2]
The aquarium pays for the water that will be used to fill up the tank. Use the volume (in cubic metres) calculated in QUESTION 1.1 to calculate the cost of the water required to fill up the tank.
NUMBER OF LITRES | COST |
The first 500 litres | 25 cents per litre |
The next 300 litres | 35 cents per litre |
The remaining litres | 45 cents per litre |
Example of output if the volume is 2 928.75 cubic metres:
(9)
1.3 Button [Question 1_3]
A shark can only stay in a tank for a specific period of time before it has to be released. The user has to enter the lifespan of a shark in a tank in months.
Write code to convert the number of months entered into years and months and display the years and months as shown in the example below.
Example of output if the number of months that was entered is 87:
(6)
1.4 Button [Question 1_4]
The management wants to know how many years it will take to pay off the initial expense of setting up the shark tank. The annual income earned will be used to pay off the expense. The initial amount that was spent to set up the shark tank and the expected income during the first year must be entered.
After the first year of operation it is expected that the income will increase by 10% per year.
Use the values entered to calculate and display the year number, the annual income and the annual balance of the set-up cost. If the initial cost is paid off, display the words 'Paid off' in the 'Balance' column. All monetary values must be formatted to a currency with two decimal places.
Example of output if the cost to set up the tank was R500 000 and the expected income during the first year is R75 000:
(14)
1.5 Button [Question 1_5_1]
There will be an opening day to celebrate the completion of the shark tank. Visitors who attend the opening day will get the opportunity to participate in various fun activities. One of the activities is a dice game, during which the visitor can win a swimming course or a snorkelling course if the numbers on the two dice thrown are consecutive numbers.
NOTE: Each dice has six faces.
Consecutive numbers are numbers that follow each other.
Write code to do the following:
Example of output if the numbers generated are not consecutive:
Example of output if the numbers generated are consecutive:
Button [Question 1_5_2]
Select one of the courses as a prize and write code to do the following:
|
TOTAL SECTION A: 50
SECTION B
QUESTION 2: OBJECT-ORIENTATED PROGRAMMING
Aqua Wonderland is hosting a special five-day educational programme at the aquarium. Schools can arrange with the administrators at the park to take learners on an excursion to the aquarium on any one of the specific days when the programme is hosted. When a school requests to visit the park on a specific date, the administrators will confirm whether the school can attend, depending on the space available to accommodate the group of learners. |
Do the following:
Delphi programmers | Java programmers |
|
|
Example of user interface:
The attributes for the Excursion object are as follows:
NAMES OF ATTRIBUTES | DESCRIPTION | |
Delphi | Java | |
fSchoolName | schoolName | The name of the school |
fVisitDate | visitDate | The date the school wants to visit the aquarium in the format YYYY-MM-DD |
fGroupSize | groupSize | The number of learners in the group |
fTourGuide | tourGuide | A Boolean attribute with the value of 'true' if the school requires a tour guide or 'false' if the school does not require a tour guide |
Complete the code in the given Excursion object class (TExcursion/Excursion) as described in QUESTION 2.1.1 to QUESTION 2.1.5 below.
2.1.1 Write a mutator method called setVisitDate to receive a date as parameter and replace the current date to visit the aquarium with the date received. (2)
2.1.2 Write a method called requireTourGuide to return the word 'Yes' if a tour guide is required, or 'No' if a tour guide is not required. (4)
2.1.3 A maximum of 500 visitors are allowed to attend the aquarium programme each day. The school will not be allowed to attend the programme if there is no space available on the requested date.
Write a method called isConfirmed that will receive the total number of visitors already attending the programme on the requested date as a parameter. The method must use the parameter value to determine whether the maximum value of 500 visitors per day will be exceeded, or not, if this school is allowed to attend the programme on the requested date. Return a Boolean value of 'true' if the school is allowed to attend the programme based on available space, or 'false' if not. (5)
2.1.4 The park wants to encourage schools to attend the aquarium programme by allowing free entrance to one learner for every ten learners in the group.
Write a method called calcAmount that will receive the cost per person and the cost of a tour guide as parameters and calculate and return the total amount to be paid. (7)
2.1.5 Complete the toString method to return the information about the excursion in the following format:
School name: <school name> Date of visit: <visit date> Number of learners: <size of the group> |
Example of output:
School name: Forest Manor High (4) |
2.2 An incomplete class Question2_U/Question2 is provided. Details of the school applying to go on an excursion to visit the aquarium must be entered by the user. The program must determine whether the school can be accommodated on the requested date and provide alternative dates if the school cannot be accommodated on the requested date.
A text file called DataQ2.txt contains information on all the schools that have been accepted to attend the aquarium's educational programme.
The text file will be used in QUESTION 2.2.2.
The format of each line in the text file is as follows:
<School name>#<Date of visit>#<Number of learners>
The first four lines of the text file are as follows:
2.2.1 Button [2.2.1 – Instantiate object]
The user needs to enter the name of the school, select the date on which they want to visit the aquarium from the list box and enter the number of learners in the group.
An Excursion object named objExcursion has been declared globally. Write code to use the data that was entered to instantiate a new Excursion object.
Display a message using a dialog box to indicate that the object has been instantiated successfully. (7)
2.2.2 Button [2.2.2 – Confirm availability]
Display a message in a dialog box indicating no availability.If the school cannot visit the aquarium on the selected date, do the following:
School name: Hovener Secondary
Date of visit: 2016-11-15
Number of learners: 150
Tour guide: Yes
Example of output if the school cannot be included on the selected date of the visit:
The combo box in the panel pnlAvailability populated with all the dates on which the school can visit the aquarium, based on space available:
(16)
2.2.3 Button [2.2.3 – Confirm new date]
If alternative dates are displayed in the combo box, the user must select a date. The program must set the date of the object to the selected date and display the school information together with the amount to be paid, using a message dialog box, as shown in the example below.
If there are no alternative dates displayed in the combo box, display a message indicating that the school's request to go on the excursion is unsuccessful. (5)
|
TOTAL SECTION B: 62
SECTION C
QUESTION 3: PROBLEM-SOLVING PROGRAMMING
SCENARIO |
Do the following:
Supplied GUI:
The supplied GUI represents a self-help interface to assist visitors in reaching various activities and facilities within the park.
Supplied data:
You are provided with two parallel arrays and one two-dimensional array.
arrActivities is a one-dimensional array that contains the names of activities and facilities in the park. The data stored in this array are as follows:
Water park, Aquarium, Sea, Restaurants, Shopping, Diving, Help desk, Penguin park, Shark tank, Dolphin shows
A corresponding parallel array called arrCodes contains letters from the alphabet, each representing the corresponding activity/facility described in the arrActivities array.
The arrCodes array contains the following elements:
W, A, S, R, X, D, H, P, T, L
The first element (letter W) in the arrCodes array represents the first element ('Water park') in the arrActivities array, the second element (letter A) in the arrCodes array represents the second element ('Aquarium') in the arrActivities array, and so on.
arrActCodes is a two-dimensional array that contains a combination of codes that represent activities and facilities that are accessible from a specific terminal when the visitor departs in a specific direction. The codes contained in this array are as follows:
NOTE: The row and column headings are not provided as part of the two-dimensional array.
Example:
The activity code that applies when a visitor walks from Terminal 1 in a northerly direction is DXWAT.
Using the content of the arrCodes and arrActivities arrays, it can be established that the activities and facilities that the code DXWAT refers to are Diving, Shopping, Water park, Aquarium and Shark tank.
NOTE:
3.1 Button [3.1 – Activity/Facility codes for all terminals and directions]
The program must display the content of the two-dimensional array arrActCodes neatly in rows and columns. Display the directions as column headings and the terminals as row labels.
Example of output:
(9)
3.2 Button [3.2 – Activities/Facilities from a selected terminal and direction]
The buttons that contain images must be used to select a terminal and direction. Code is provided to assign the selected terminal and direction to variables. The program must then use the supplied arrays to identify all the activities and facilities available on the selected route. Display the selected terminal and direction as a heading and a list of activities and facilities on the route selected.
Example of output if Terminal 2 and South are selected:
(11)
3.3 Button [3.3 – Access routes to selected activity/facility]
Once the user selects a specific activity/facility from the combo box provided, the user must be able to view all access routes to that specific activity/facility. Display the terminal number and the direction for each access route for the visitor to be able to reach the activity/facility selected.
The total number of access routes leading to the activity selected must be determined and displayed.
Example of output if Aquarium was selected from the combo box:
(10)
3.4 Button [3.4 – Maintenance at selected activity/facility]
The area where activities take place or facilities are provided may sometimes be closed due to maintenance. The user must select an activity/facility where maintenance must take place from the combo box provided. The program must remove all references to the selected activity/facility from the two-dimensional array and display a suitable message in a dialog box indicating that the information has been updated. The updated content of the two-dimensional array must be displayed in the output area.
Example of output if Diving was selected from the combo box:
Example of output after removing the letter D from the two-dimensional array arrActCodes due to maintenance that must be done on the diving facility:
(8)
|
TOTAL SECTION C: 38
GRAND TOTAL: 150