School ICT Self Study

Nested Structures and Arrays

73 viewsG11-01. Programming
0

  1. Write pseudo code to check if a number is positive and even.

  2. Write pseudo code to print a 3Γ—3 grid of asterisks using nested loops.

  3. Write pseudo code to check if a number is both prime and odd.

  4. What are the key properties of a one-dimensional array?

  5. Write pseudo code to initialize an array with the first five even numbers.

Spread the love
Ruwan Suraweera Changed status to publish May 26, 2025
0

Answers and Descriptions

  1. Answer:

Description: Nested If statements check for positive and even conditions, demonstrating layered decision-making in programming.

  1. Answer:

Description: Nested loops iterate over rows and columns to print a grid, testing the ability to manage multiple iteration levels.

  1. Answer:

Description: This combines selection (odd check) and iteration (prime check), testing complex nested logic integration.

  1. Answer: Index, contiguous locations, random access.
    Description: A one-dimensional array stores elements linearly, accessed via indices (starting at 0), in contiguous memory, supporting efficient random access.

  2. Answer:

Description: This pseudo code declares and assigns even numbers to an array, demonstrating basic array manipulation skills.

Spread the love
Ruwan Suraweera Changed status to publish May 26, 2025
Write your answer.