Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Chirs Mendenhall
Chirs Mendenhall
4,392 Points

Soccer Coordinator letters?

I submitted my first project and i get back that i did not add the personalized letters. The thing is i did submit them and here is my code. It prints all 18 letters so i dont see the problem any help would be awesome thank you!

Here is what they said,

Reviewer Comments:

Excellent job so far on this project! Each letter is formatted well, and includes the player's name with the associated guardian name, team name, and the date/time of the first team practice.

However, all 18 letters are required to be stored in a collection variable named 'letters'.

Overall, this section is very well written and each letter prints exactly as one would hope, formatted and containing all the required player information. Great work!

// Print Sharks letters

for player in teamSharks { print("Dear (player[guardians]!), your child, (player[name]!), has been placed on the team Sharks. The first practice for the Sharks is March 17, 3pm.") }

// Print Dragons letters

for player in teamDragons { print("Dear (player[guardians]!), your child, (player[name]!), has been placed on the team Dragons. The first practice for the Dragons is March 17, 1pm.") }

// Print Raptors letters

for player in teamRaptors { print("Dear (player[guardians]!), your child, (player[name]!), has been placed on the team Raptors. The first practice for the Raptors is March 18, 1pm.") }

1 Answer

Looks like the requirements for this must of changed a bit since I did it.

Just at first glance why don't you create a function called printMessages and just call that same function on each team to print them instead of duplicating code.

Next you need to append the letters (the strings) to an array named 'letters' it looks like.

Also when posting code make sure to use 3 back ticks followed by Swift above your code and then 3 back ticks below your code like below:

```Swift
   //Your code here
``` //Followed by 3 more back ticks after

Also remember as a Tech Degree student you can jump on the Slack channel to get help also.