官术网_书友最值得收藏!

Chapter 2. Learning about Variables, Constants, Strings, and Operators

The first program I ever wrote was written in the basic programming language, and was the typical Hello World application. This application was pretty exciting at first, but the excitement of printing static text wore off pretty quickly. For my second application, I used basic's input command to prompt the user for a name and then printed out a custom hello message to the user with their name in it. At the age of 12, it was pretty cool to display Hello Han Solo. This application led me to create numerous Mad Lib style applications that prompted the user for various words and then put those words into a story that was displayed after the user entered all the required words. These applications introduced me to, and taught me, the importance of variables. Every useful application I created since then has used variables.

In this chapter, we will cover the following topics:

  • What are variables and constants?
  • Difference between explicit and inferred typing
  • Explaining numeric, string, and Boolean types
  • Defining what optional types are
  • Explaining how enumerations work in Swift
  • Explaining how Swift's operators work
主站蜘蛛池模板: 尤溪县| 新兴县| 赤水市| 耒阳市| 循化| 昌邑市| 柏乡县| 饶河县| 临高县| 定结县| 陵水| 浮山县| 新源县| 嘉黎县| 神池县| 阿尔山市| 湖北省| 米易县| 宁远县| 洞头县| 福安市| 嘉善县| 芮城县| 合水县| 曲水县| 元谋县| 博罗县| 华容县| 资中县| 无锡市| 唐海县| 泌阳县| 津南区| 城口县| 达拉特旗| 谢通门县| 洛阳市| 酉阳| 鄄城县| 呼伦贝尔市| 红桥区|