Skip to content

Course home

String handling operations in a programming language

String handling operations in a programming language

EasyMedium
1234567891011121314151617181920
Question 8

A digital publishing platform wants to automatically generate unique catalog keys for books in its database.

Table 1 shows some examples of book details.

bookIDauthorSurnamepublisher
B7HAWTHORNEPENGUIN
B12ORWELLHARPER
B3TOLKIENVINTAGE

A catalog key is made up of the:

  • bookID
  • second letter and the fourth letter of the authorSurname
  • first letter of the publisher

For example:

  • The catalog key for HAWTHORNE would be B7ATP
  • The catalog key for ORWELL would be B12REH

Write a C# program to create this catalog key.

The program should:

  • Get the user input for bookID, authorSurname, and publisher
  • Create the correct catalog key
  • Assign the catalog key to a variable called key

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