Skip to content

Course home

String handling operations in a programming language

String handling operations in a programming language

EasyMedium
1234567891011121314151617181920
Question 14

A marine research laboratory wants to generate unique tracking codes for the marine specimens they catalog.

The table below shows some example specimen details.

specimenIDspeciesNameoceanZone
S82OCTOPUSABYSSAL
S95JELLYFISHPELAGIC

A tracking code is made up of the:

  • specimenID
  • second letter and the fifth letter of the speciesName
  • second letter of the oceanZone

For example:

  • The tracking code for specimen S82 (OCTOPUS in the ABYSSAL zone) would be S82CPB
  • The tracking code for specimen S95 (JELLYFISH in the PELAGIC zone) would be S95EYE

Write a C# program to create this tracking code.

The program should:

  • Get the user input for specimenID, speciesName and oceanZone
  • Create the correct tracking code
  • Assign the tracking code to a variable called code

You should use meaningful variable name(s) and C# syntax in your answer.

[4]
Markscheme

String handling operations in a programming language Questions

  1. GCSE
  2. /Computer Science
  3. /String handling operations in a programming language

89 exam-style questions on AQA GCSE Computer Science String handling operations in a programming language. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank