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

Explain the following concepts: (i) Valid data

96%

114 rated

Answer

Valid data refers to information that meets the required criteria for a specific format, range, or type of data. For example, an input field for a date should only accept date values and not text or symbols.

Step 2

(ii) Verified data

99%

104 rated

Answer

Verified data indicates that the user has confirmed that the correct option has been selected or correct data has been entered. This is often achieved through confirmation messages or review prompts before submission.

Step 3

Explain how the component suggested for data input (1) in QUESTION 5.1.1 will ensure that valid data is entered.

96%

101 rated

Answer

Using the appropriate input components, such as drop-down lists or radio buttons, restricts user input to predefined options. This reduces the chance of invalid data entry, as users can only select from valid choices.

Step 4

Explain what is meant by a logical error.

98%

120 rated

Answer

A logical error occurs when the program runs without crashing but produces incorrect results or output due to flawed logic or calculations.

Step 5

Replace x and y in the statement, so that the total for each month will be correctly stored in the 2D array.

97%

117 rated

Answer

Replace x and y with counter1 and 3, respectively, in the statement so that it reads: arrVisitors[counter1, 3] ← total.

Step 6

Which ONE of the statements (A–C) below describes the position in the algorithm where this statement must be inserted CORRECTLY?

97%

121 rated

Answer

A, between lines 6 and 7.

Step 7

Indicate the changes that need to be made in lines 2 to 5.

96%

114 rated

Answer

Modify line 2 to reflect the correct counting of columns instead of rows. Use:

For counter1 ← 1 to 2
    total ← 0
    For counter2 ← 1 to 12
        total ← total + arrVisitors[counter2,counter1]
    End inner loop
End outer loop

This allows the calculation of totals for each park.

Step 8

Write pseudocode to swap the two values in the array.

99%

104 rated

Answer

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

Step 9

What does the abbreviation OOP refer to?

96%

101 rated

Answer

OOP stands for Object-Oriented Programming, which is a programming paradigm based on the concept of 'objects' that can contain data and code.

Step 10

What is the purpose of a constructor method in a class?

98%

120 rated

Answer

The purpose of a constructor method is to initialize an object when it is created, setting initial values for its attributes.

Step 11

Motivate why it is NOT necessary to have the field numberOfDays as an attribute of the class.

97%

117 rated

Answer

It is not necessary to have numberOfDays as an attribute because it can be derived from other attributes (like startDate and endDate) whenever needed, thus avoiding redundancy.

Step 12

What is the implication of declaring the method calcDays() as a private method?

97%

121 rated

Answer

Declaring calcDays() as a private method means it cannot be accessed outside the class, promoting encapsulation and restricting unintended interference.

Step 13

Explain why a setStartDate(startDate) can alter the state of the booking changed.

96%

114 rated

Answer

The setStartDate(startDate) method allows external code to change the start date attribute of the object. This method alters the state by updating the object's properties.

Step 14

Explain the purpose of a toString() method.

99%

104 rated

Answer

The toString() method is used to provide a string representation of the object, combining all the attributes into 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

;