7Medium
0/4

An agricultural research laboratory wants to create tracking codes for soil samples collected in the field.

The table below shows details of some of the samples:

sampleIDlocationsoilType
S9DEVONPEAT
S12YORKSHIRESILT
S15KENTSAND

A tracking code is made up of the:

  • sampleID
  • first letter and second letter of the location
  • first letter of the soilType

For example:

  • the tracking code for S9 in DEVON with PEAT would be S9DEP
  • the tracking code for S12 in YORKSHIRE with SILT would be S12YOS

Write a VB.NET program to create the tracking code for a soil sample.

The program should:

  • get the user to enter the sampleID, location, and soilType
  • create the tracking code according to the rules above
  • assign the tracking code to a variable called trackingCode

You should use meaningful variable name(s) and VB.NET syntax in your answer.

[4]

String handling operations in a programming language Questions

Practise AQA GCSE Computer Science String handling operations in a programming language with exam-style questions for GCSE Computer Science. 90 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

String handling operations in a programming language Questions

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