Programming Fundamentals/Variable Examples Swift

Overview
The following examples demonstrate data types, arithmetic operations, and input in Swift.

Output
Integer i = 1234567890 Double d = 1.23456789012345 String s = string Boolean b = true

Discussion
Each code element represents:
 * begins a comment
 * defines an integer variable named i
 * defines a double floating-point variable named d
 * defines a string variable named s
 * defines a Boolean variable named b
 * assign literal values to the corresponding variables
 * calls the print function

Output
a = 3 b = 2 a + b = 5 a - b = 1 a * b = 6 a / b = 1 a % b = 1

Discussion
Each new code element represents:
 * represent addition, subtraction, multiplication, division, and modulus, respectively.

Output
Enter Fahrenheit temperature: 100 100.0° Fahrenheit is 37.7777777777778° Celsius

Discussion
Each new code element represents:
 * reads the next line from standard input
 * converts the input to a double floating-point value
 * converts the output numeric value to a string