I have ISYS120 Homework project, Swift programming.

Playgrounds Project 2: (100 points)


Playground 1 (Playground Basics):

Download and complete the following playground in Xcode: (Submit a screen shot or two from the playground):

01_PlaygroundBasics.playground.zip

Once you are comfortable working in playgrounds, try to create your own playgrounds following these steps in Xcode:

 

-Choose Playground from the File > New menu.

 

-Enter a name for the new playground.

 

-Choose iOS from the Platform menu.

 

-Add a series of numbers to the playground, then add comments that indicate what the numbers mean.

 

Things to try:

 

-Add the ages of the people in your immediate family.

 

-Using today’s year and your birth year, calculate how 
old you are (or will be) on your birthday this year.

 

-Calculate how many ounces are in five pints, two gallons, and one quart.

 

Reflection Questions:

 

What surprised you most about using the playground?

 

What other kinds of calculations could you store and run in a playground?

 

Examples include, how many seconds there are in a day or a week, or calculate a dog’s age in human years, assuming he is five years old and one human year is equal to seven dog years.

 

What else do you wish a playground could do?

 

What calculations did you try when you were creating your own playground?


Playground 8 (Constants and Variables):


Download and complete the following playground in Xcode: (Submit a screen shot or two from the playground):

08_Variables.playground.zip

 

Reflection Questions:

Look around the room you’re in. Can you divide the things in the room into constants and variables? If you were in the same room tomorrow or next week, what would be the same and what would have changed?

Think of the rules of a sport or game. During the course of the game, what is constant and what is variable? Would the game be better if anything about it could change at any time, or do the constants help? 
 

 

Think of an app that you use and all of the information 
it holds to do its job. Can you divide the information up into variables and constants?


Playground 9 (Types):


 Download and complete the following playground in Xcode: (Submit a screen shot or two from the playground):

09_Types.playground.zip

 

Reflection Questions:

Think of a single screen of an app you use. How many different types of information do you think are involved? Can you think of other types beyond strings and numbers?



How would you write a program that dealt with a music collection? What types might you need?