Woohoo! You made it through section 1 and now have a good understanding of the fundamentals of Swift! That wasn't so bad, right? Now let's put your skills to the test.
Create a new Swift Playground.
Declares a few variables to your Playground of the following types and assign them any valid values:
Write a function which calculates the volume of a cube. It should accept one parameter (side length) and return a value of type
Double for the volume. The formula to determine the area of a cube is: V = a^3^
Create an array containing the names of your 4 favorite Pokémon. The values should be of type
for-in loop that loops through the Pokémon array and prints
"[Pokémon name goes here], I choose you!"
Create a Dictionary that contains the make and model of 4 different cars you like. If you don't like cars, you can use something else. 😀
Create a Boolean variable called
downloadFinished and write a conditional statement (
if/else) which checks to see if it is true or not and then prints a relevant message.
Create a class called
Shoe and give it properties for
hasLaces of type Bool,
color of type String, and
releaseDate of type Int.
9.) Create subclasses of
Shoe for three different models of shoes that you like and initialize the variables with the relevant data for each shoe model.
git remote add)
If you refresh your repository on github.com you should see the Playground file loaded up on your Github page.