Skip to content

Course home

Develop code

Develop code

EasyMediumHard
123456789101112
Question 10

A program contains a 2-dimensional data structure named theAstronauts which stores the first name, last name, and year of selection for a group of astronauts.

An example of the data structure is shown below:

theAstronauts = [
    ["Helen", "Sharman", 1989],
    ["Yuri", "Gagarin", 1960],
    ["Mae", "Jemison", 1987],
    ["Tim", "Peake", 2009],
    ["Sally", "Ride", 1978]
]
theLabels = []

Mission badges require a unique label to be generated for each astronaut. The label is created by joining:

  1. The first letter of their last name.
  2. The first letter of their first name.
  3. Their year of selection.

For example, the label for ["Helen", "Sharman", 1989] would be "SH1989".

Write a program in Python or a standard pseudocode to:

  • Process each astronaut in theAstronauts to generate their unique label.
  • Store all generated labels in the 1-dimensional data structure named theLabels.
  • Display all the generated labels.
  • Find and display the first name, last name, and selection year of the most recently selected astronaut (the one with the largest selection year value).

Your program must function correctly even if theAstronauts contains a different number of records or different data.

[20]
Markscheme

Develop code Questions

  1. IGCSE
  2. /Computer Science
  3. /Develop code

62 exam-style questions on Edexcel IGCSE Computer Science Develop code. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank