5.1 The travel agency uses the interface below as a booking form for holiday accommodation - NSC Information Technology - Question 5 - 2017 - Paper 2
Question 5
5.1 The travel agency uses the interface below as a booking form for holiday accommodation. The different types of available accommodation can be categorised as 'cam... show full transcript
Worked Solution & Example Answer:5.1 The travel agency uses the interface below as a booking form for holiday accommodation - NSC Information Technology - Question 5 - 2017 - Paper 2
Step 1
5.1.1 (a)(i) Valid data
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Valid data refers to data that meets the specific format, range, or type requirements set for the input. This ensures that the information provided is appropriate for the context in which it is used.
Step 2
5.1.1 (a)(ii) Verified data
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Verified data is the information that a user confirms is correct or has been accurately entered. This process often involves checks to ensure that the data aligns with existing criteria or data sets.
Step 3
5.1.1 (b) Component for Valid Data
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The proposed input component, such as a combo box or radio button, offers a controlled environment for data entry. This limits user input to predefined choices, thereby minimizing the risk of invalid entries and ensuring that the data conforms to the expected types.
Step 4
5.2.1 Logical error
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
A logical error occurs when a program runs successfully but produces incorrect results or output due to flaws in its logic or reasoning, rather than syntax errors.
Step 5
5.2.2 (a) Replace x and y
97%
117 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
In the statement, replace x with 'counter1' and y with '2' to correctly store the total for each month, resulting in: arrVisitors[counter1, 2] = total.
Step 6
5.2.2 (b) Position of insertion
97%
121 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
This statement must be inserted between lines 6 and 7 of the algorithm, as it is where calculations are finalized.
Step 7
5.3 Indicate Changes
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To determine the total number of visitors, modify lines 2 to 5 to iterate through both parks and sum their visitors accordingly.
For counter1 ← 1 to 12
total ← 0
For counter2 ← 1 to 2
total ← total + arrVisitors[counter1, counter2]
End inner loop
Step 8
5.2.4 Pseudocode to Swap Values
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To swap the values for 'Fun park' and 'Animal park' in May, the pseudocode would be:
Sign up now to view full answer, or log in if you already have an account!
Answer
OOP refers to Object-Oriented Programming, a programming paradigm based on the concept of 'objects', which can contain data and code to manipulate that data.
Step 10
5.3.2 Purpose of a Constructor Method
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The constructor method is crucial for instantiating an object. It initializes new objects with specific attributes and prepares them for use.
Step 11
5.3.3 Necessity of numberOfDays attribute
97%
117 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
It is unnecessary to have 'numberOfDays' as a separate attribute because this value can be computed from other attributes such as 'startDate' and 'endDate'.
Step 12
5.3.4 Implication of Private Method
97%
121 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Declaring 'calcDays()' as a private method restricts access to the method from outside the class, ensuring that only the class itself can manipulate or call it, which enhances data security.
Step 13
5.3.5 Purpose of setStartDate Method
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The setStartDate method is necessary to modify the starting date after the object's creation. It allows for flexibility in setting booking dates, which may vary.
Step 14
5.3.6 Purpose of toString() Method
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The toString() method is designed to provide a string representation of the object, which consolidates and presents all attributes in a single, readable format.