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

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
主站蜘蛛池模板: 嵊泗县| 鹤岗市| 无棣县| 南通市| 海伦市| 巍山| 华阴市| 灌南县| 桐城市| 龙江县| 长宁区| 广元市| 荥经县| 荥阳市| 搜索| 察隅县| 嵊泗县| 神农架林区| 石渠县| 阳曲县| 察雅县| 北宁市| 瓮安县| 任丘市| 泉州市| 武穴市| 丰县| 冷水江市| 兴安县| 浦东新区| 漳平市| 长岛县| 大足县| 赤壁市| 施秉县| 九龙县| 漳平市| 锦屏县| 屏南县| 罗源县| 涞源县|