Photo AI

The program must display the layout of the mall - NSC Information Technology - Question 3 - 2017 - Paper 1

Question icon

Question 3

The-program-must-display-the-layout-of-the-mall-NSC Information Technology-Question 3-2017-Paper 1.png

The program must display the layout of the mall. Write code to use the data supplied in the two-dimensional array to display the layout in neat columns. Example of ... show full transcript

Worked Solution & Example Answer:The program must display the layout of the mall - NSC Information Technology - Question 3 - 2017 - Paper 1

Step 1

Button [Display layout]

96%

114 rated

Answer

To display the layout of the mall as per the data in the two-dimensional array, follow these steps:

  1. Outer Loop for Rows: Iterate through each row of the array, using a loop to control the index for rows.

  2. Inner Loop for Columns: For each row, implement an inner loop to iterate through all the columns of the row.

  3. Display Symbols: Within the inner loop, access each element of the array at the current row and column indices. Print each character with appropriate formatting so that they are displayed in neat columns. Use spaces for better visual alignment.

This approach ensures that each character representing a restaurant or a placeholder is reliably represented in the output.

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

;