Photo AI

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 icon

Question 5

5.1-The-travel-agency-uses-the-interface-below-as-a-booking-form-for-holiday-accommodation-NSC Information Technology-Question 5-2017-Paper 2.png

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

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

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

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

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

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

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

Answer

To determine the total number of visitors, modify lines 2 to 5 to iterate through both parks and sum their visitors accordingly.

  1. For counter1 ← 1 to 12
  2. total ← 0
  3. For counter2 ← 1 to 2
  4. total ← total + arrVisitors[counter1, counter2]
  5. End inner loop

Step 8

5.2.4 Pseudocode to Swap Values

99%

104 rated

Answer

To swap the values for 'Fun park' and 'Animal park' in May, the pseudocode would be:

temp ← arrVisitors[5, 1]
arrVisitors[5, 1] ← arrVisitors[5, 2]
arrVisitors[5, 2] ← temp

Step 9

5.3.1 OOP meaning

96%

101 rated

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

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

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

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

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

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.

Join the NSC students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;