Master C++

Conference badge

Conference badge

A conference prints a badge for everybody who arrives. The badge machine hands your function a name and a role, and wants one line of text back, in exactly the same shape every time so that the badges all line up.

Write badge, which returns the name, then a comma, then a single space, then the role.

Worked example

Input:  name = "Ada Lovelace", role = "Speaker"
Output: "Ada Lovelace, Speaker"

Input:  name = "Jo", role = "Guest"
Output: "Jo, Guest"

Constraints

  • name is between 0 and 60 characters long.
  • role is between 0 and 30 characters long.
  • Use both exactly as they arrive. Do not change the capitalisation and do not trim the ends.
  • Either one may be empty, and the shape of the badge does not change when it is. An empty role gives "Jo, ", with the comma and the space still there.
Code

Run your code to see how it does on the examples. Submit also runs the hidden cases.