Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Swift iOS Programming for Kids
  • Toc
  • feedback
Swift iOS Programming for Kids

Swift iOS Programming for Kids

By : D. Sommer, Campagno
4.2 (5)
close
Swift iOS Programming for Kids

Swift iOS Programming for Kids

4.2 (5)
By: D. Sommer, Campagno

Overview of this book

This book starts at the beginning by introducing programming through easy to use examples with the Swift Playgrounds app. Kids are regularly encouraged to explore and play with new concepts to support knowledge acquisition and retention – these newly learned skills can then be used to express their own unique ideas. Children will be shown how to create their first iOS application and build their very own movie night application.
Table of Contents (15 chapters)
close
2
2. Getting Set Up
10
10. Pokémon Battle
13
13. Space Pizza Delivery

A simple program without functions


Having an understanding of how our iPhone reads our code as a line by line recipe can help us understand the need for the concept of a function.

Let's imagine, for a moment, that we do not have any concept of functions when writing our code. Then, if we want to make a simple app that simulates the making of a pizza, we can write the following code:

print("Flattening the dough to form a round pizza ")
print("Adding some tomato sauce ")
print("Adding some mozzarella cheese ")
print("Adding some spicy pepperoni ")
print("Preparing the pizza in the oven ")
print("Done! Delicious pizza ready to be eaten ")

Tip

All related source code for this chapter can be found here: https://github.com/swift-book-projects/swift-3-programming-for-kids/tree/master/Chapter-6

When we run this application, it will simply output the simulation of making a pizza to the console:

How will we write our code if we want our program to make multiple pizzas? The first thing that comes to mind...

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete