// Likeswift.swift Copyright (c) Kari Laitinen // http://www.naturalprogramming.com // 2014-09-29 File created. // 2015-10-17 Last modification. import Foundation print( "\n Do you like the Swift programming language?" + "\n Please, answer Y or N : ", terminator: "" ) // Although the name of the following variable says // 'character' we will receive a String from the keyboard. var character_from_keyboard : String! = readLine() if character_from_keyboard == "Y" || character_from_keyboard == "y" { print( "\n That's nice to hear. \n" ) } else if character_from_keyboard == "N" || character_from_keyboard == "n" { print( "\n That is not so nice to hear. " + "\n I hope you change your mind soon.\n" ) } else { print( "\n I do not understand \"" + character_from_keyboard + "\".\n" ) }