Photo AI

QUESTION 3: PROBLEM-SOLVING PROGRAMMING SCENARIO Information centres, referred to as 'terminals', have been set up at three different points along the routes in the park - NSC Information Technology - Question 3 - 2016 - Paper 1

Question icon

Question 3

QUESTION-3:-PROBLEM-SOLVING-PROGRAMMING--SCENARIO--Information-centres,-referred-to-as-'terminals',-have-been-set-up-at-three-different-points-along-the-routes-in-the-park-NSC Information Technology-Question 3-2016-Paper 1.png

QUESTION 3: PROBLEM-SOLVING PROGRAMMING SCENARIO Information centres, referred to as 'terminals', have been set up at three different points along the routes in th... show full transcript

Worked Solution & Example Answer:QUESTION 3: PROBLEM-SOLVING PROGRAMMING SCENARIO Information centres, referred to as 'terminals', have been set up at three different points along the routes in the park - NSC Information Technology - Question 3 - 2016 - Paper 1

Step 1

Button [3.1] – Activity/Facility codes for all terminals and directions]

96%

114 rated

Answer

To display the activity/facility codes for all terminals and directions, the program needs to:

  1. Display Column Headings: Show the directions (North, South, East, West) as the column headers.
  2. Loop through Rows: Use an outer loop to iterate over each terminal and its number.
  3. Inner Loop: Use an inner loop to go through the columns for the directions.
  4. Display Data: For each terminal, extract the relevant data from the two-dimensional array arrACodes and display it. The output should look organized, ensuring each entry is on a new line.
  5. End the Output Neatly: Make sure to display the lines in the output area in a clear and readable format.

Step 2

Button [3.2] – Activities/Facilities from a selected terminal and direction]

99%

104 rated

Answer

The steps to extract and display activities from a selected terminal and direction are as follows:

  1. Display Terminal Number and Direction: First, display the selected terminal number and the chosen direction in the output area.
  2. Extract Code: Retrieve the activity code from the arrCodes corresponding to the selected terminal and direction.
  3. Loop through Codes: Iterate through the arrCodes array to find the relevant activities by comparing each letter in the code.
  4. Display Activities: Show all activities that correspond to the selected terminal and direction in the output.

Step 3

Button [3.3] – Access routes to selected activity/facility]

96%

101 rated

Answer

To access routes for the selected activity/facility, follow these steps:

  1. Extract Index: Get the index of the selected activity/facility from the combo box.
  2. Initialize Counter: Set a counter to zero to count the number of access routes.
  3. Display Heading: Show a heading in the output area indicating access routes.
  4. Outer Loop for Rows: Loop through each entry in the rows of the two-dimensional array, checking for matches with the selected activity code.
  5. Inner Loop for Columns: For each match, display the corresponding terminal number and direction, incrementing the counter each time a valid route is found.
  6. Display Total Routes: Display the total number of access routes found.

Step 4

Button [3.4] – Maintenance at a selected activity/facility]

98%

120 rated

Answer

To handle maintenance information for selected activities/facilities:

  1. Extract Activity Index: Get the index of the selected activity from the combo box.
  2. Loop through Rows: Iterate through the rows of the arrACodes array.
  3. Check for Activity: Check if the selected activity code exists within the data. If it does, remove the corresponding character from the arrACodes array.
  4. Display Maintenance Message: Inform the user with a message indicating the access routes to the selected activity/facility are closed due to maintenance.
  5. Update Output Area: Finally, refresh the display to show the updated arrACodes array, reflecting the changes made.

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

;