Mini-exercises

  1. Write a function named printFullName that takes two strings called firstName

and lastName. The function should print out the full name defined as firstName

  • " " + lastName. Use it to print out your own full name.

  • Change the declaration of printFullName to have no external name for either parameter.

  • Write a function named calculateFullName that returns the full name as a string. Use it to store your own full name in a constant.
  • Change calculateFullName to return a tuple containing both the full name and the length of the name. You can find a string’s length by using the following syntax: string.characters.count. Use this function to determine the length of your own full name.

results matching ""

    No results matching ""