Skip to content

Course home

String handling operations in a programming language

String handling operations in a programming language

EasyMedium
1234567891011121314151617181920
Question 1

A garden center wants to create unique stock codes for the plants they sell.

Table 1 shows some example plant details.

plantIDplantNamesupplier
P1LAVENDERGREENGLOW
P2MARIGOLDBLOOMTIME
P3BEGONIASUNGROW

A stock code is made up of the:

  • plantID
  • first letter and the third letter of the plantName
  • first letter of the supplier

For example:

  • The stock code for LAVENDER would be P1LVG
  • The stock code for MARIGOLD would be P2MRB

Write a C# program to create this stock code.

The program should:

  • Get the user input for plantID, plantName and supplier
  • Create the correct stock code
  • Assign the stock 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