Swift: xCode Exercise - Concatenation and Interpolation Create a city constant and assign it a string literal
Fantastic news! We've Found the answer you've been seeking!
Question:
Swift: xCode
Transcribed Image Text:
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 <INSERT NAME HERE> and after my next birthday I will be <INSERT AGE HERE> years old." Insert name where indicated, and insert a mathematical expression that evaluates to your current age plus one where indicated. 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 <INSERT NAME HERE> and after my next birthday I will be <INSERT AGE HERE> years old." Insert name where indicated, and insert a mathematical expression that evaluates to your current age plus one where indicated.
Expert Answer:
Answer rating: 100% (QA)
public class Info public static void mainString args Part 1 final String Cit... View the full answer
Related Book For
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Posted Date:
Students also viewed these electrical engineering questions
-
Swift Corporation distributes land (basis of $55,000 and fair market value of $120,000) to Sam and cash ($240,000) to Allison in exchange for part of their stock. Other shareholders do not redeem any...
-
Swift is the holding company for Swift Transportation Co., Inc., a truckload carrier headquartered in Phoenix, Arizona. Swift operates the largest truckload fleet in the United States. Before Swift...
-
Swift Corporation incorporated on January 1, 2011, and incurred $45,000 in organization costs. a. Should Swift Corporation capitalize or expense these costs? Defend your answer. b. If these costs are...
-
What is your debt payments-to-income ratio if your debt payments total $684 and your net income is $2,000 per month?
-
Using the following cost and revenue information shown for DeKalb, Inc., determine how the costs, revenue, and cash flow items would be affected by three possible exchange rate scenarios for the New...
-
Let z denote a variable that has a standard normal distribution. Determine the value z* that satisfies the following conditions: a. P(z
-
\(4+(8+\sqrt{7})=(4+8)+\sqrt{7}\) Identify the property of real numbers that is being illustrated.
-
The financial statements of The Hershey Company are presented in Appendix B, following the financial statements for Tootsie Roll Industries in Appendix A. Instructions (a) Based on the information in...
-
eBook Seven years ago the Templeton Company issued 24-year bondswith an 11% annual coupon rate at their $1,000 par value. The bondshad a 6% call premium, with 5 years of call protection. TodayTempl 2...
-
The Davis Lamp Company (DLC) is a wholesale company that purchases lamps from the manufacturer and resells them to retail stores. The company has three inventory items: desk lamps, table lamps, and...
-
You bought a pizza delivery truck for your new pizza shop. You paid $35,000 for the truck and expect it to have a $3,000 salvage value. You believe its useful life is 100,000 miles. If the truck was...
-
What is International Business management ? Importance of International Business Management
-
4. Kara has 12 eggs. Her cookie recipe calls for 4 eggs. How many batches of cookies can Kara make? 5. Maria only has 3 eggs. How much of Kara's recipe can she make?
-
Multiply. 4 x 2 ( 3 x 2 - 7 x + 4 )
-
6) The football team found that selling 20 tickets brings a profit of $460 and selling 30 tickets brings a profit of $690. Find the profit function in y=mx+b form
-
A transponder for a toll bridge costs $ 1 7 . 5 0 . With the transponder, the toll is $ 5 each time you cross the bridge. The only other option is toll - by - plate, for which the toll is $ 5 . 2 5...
-
The resultant R of two planar forces acting at a point O has direction cosines ( 3 5 , 4 5 ) . If one of the two forces is F 1 = ( 2 i + 5 j ) N and the other force F 2 has magnitude equal to 2 N ,...
-
14. In testing the existence assertion, an auditor ordinarily works from the a. Financial statements to the accounting records. b. General journal to the general ledger. c. Supporting evidence to the...
-
Which of the following statements calls the getInventory function described in Review Question 4? a. getInventory(int, int, int, int); b. getInventory(beginInv, sales, purchases, &endInv); c....
-
The amount variable contains the string 3,123,560. Write the C++ code to remove the commas from the contents of the variable.
-
Which of the following statements creates a two-dimensional array that contains three rows and four columns? a. int rates[3, 4] = {0}; b. int rates[4, 3] = {0}; c. int rates[3][4] = {0}; d. int...
-
Prove the relations (11.16), (11.18), and (11.21).
-
Do the same as in Problem 7 but for the expression \(\left\langle u\left(a u+v^{2} ight) ightangle\).
-
\(u(\boldsymbol{x}, t)\) and \(v(\boldsymbol{x}, t)\) are velocity components of a turbulent flow. The RANS averaging \(\langle v(a u+b)angle\) is evaluated, where \(a\) and \(b\) are some constants....
Study smarter with the SolutionInn App