Question: Swift: xCode Exercise - Concatenation and Interpolation Create a city constant and assign it a string literal representing your home city. Then create a state

Swift: xCode

Exercise - Concatenation and Interpolation Create a city constant and assign it

Exercise - Concatenation and Interpolation Create a city constant and assign it a string literal representing your home city. Then create a state constant and assign it a string literal representing your home state. Finally, create a home constant and use string concatenation to assign it a string representing your home city and state (i.e. Portland, Oregon). Print the value of home. Use the compound assignment operator (+=) to add home to introduction below. Print the value of introduction. 11 var introduction = "I live in" 12 13 Declare a name constant and assign it your name as a string literal. Then declare an age constant and give it your current age as an Int. Then print the following phrase using string interpolation: "My name is and after my next birthday I will be years old." Insert name where indicated, and insert a mathematical expression that evaluates to your current age plus one where indicated.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class Info public static void mainString args Part 1 final String Cit... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!