O'Reilly logo

Swift 3 ObjectOriented Programming - Second Edition by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exercises

Add new methods to the GameRepository class that we created in this chapter. Make sure you create a new method to solve each algorithm and that you use a functional programming approach:

  • Retrieve all the games whose average score is lower than a maximum average score received as an argument.
  • Generate a string with the first letter of each game name followed by the highest score value. Use a hyphen as a separator for each game name and highest score value pair. That last value pair shouldn't include a hyphen after it.
  • Calculate the minimum playedCount value.
  • Calculate the maximum playedCount value.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required