Problem Set: Initialization

This section contains a number of selected problems for the Initialization section.

It is recommended that you review the problems, and complete a few before moving on to the next section.

Problem #1: Expressing your opinions

You’ve gotten your hands on coding and now you want to share with the world how awesome you think it is. ||game:Splash|| to the screen the phrase Coding is cool!.

Problem #2: Dogs

Use a string variable named ||variables:breed|| to ||game:splash|| your favorite type of dog to the screen.

Problem #3: Animal noises

Use 2 string variables, ||variables:cow|| and ||variables:snake|| that store the sounds that these animals make (e.g. “Moo” or “Hisss”). Uses these variables to ||game:splash|| these values to the screen.

Problem #4: Ice cream

Your friend is buying you ice cream and needs to know which flavor to buy. Store your favorite flavor in a variable called ||variables:iceCream|| and ||game:splash|| it to the screen.

But wait, after you tell them, you change your mind. On the line below, change the value of ||variables:iceCream|| to another flavor of ice cream and then ||game:Splash|| that to the screen.

Problem #5: Copycat

You’re listening to music and you don’t know what songs to play. You remember your friend has great taste in music so you ask them to store the title of their favorite song as a string in a variable called ||variables:favSong||. Since you trust their music taste, you want to listen to their favorite song next.

What code would you write to create another string variable called ||variables:nextSong|| and set it to the value of your friend’s favorite song?