Skip to content

Course home

Sign up

Computational thinking

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
Question 74

An algorithm is designed to display a list of meteorological stations recorded during a weather monitoring expedition.

1      # ----- Global variables -----
2      METSTATIONS = ["North_Base", "East_Ridge", "South_Valley", "West_Coast"]
3
4      # ----- Subprograms -----
5      def displayStations (stationList):
6          for i in range (0, len (stationList)):
7              print (i, stationList[i])
8
9      # ----- Main Program -----
10     query = input ("Retrieve meteorological station names? (Y/N): ")
11     if ((query == "Y") or (query == "y")):
12         displayStations (METSTATIONS)
13     else:
14         print ("Program Terminated")

State the type of data structure used to hold the meteorological station names inside the variable METSTATIONS in this algorithm.

[1]
Markscheme

Computational thinking Questions

  1. GCSE
  2. /Computer Science
  3. /Computational thinking

Question bank