title: How to use the binary operator "%" with user input "readLine()"?
body: <p>I have been asked to write a code using If/Else statements. The code is supposed to ask the user to enter a number and then print "This number is even" if the number is even, and print "This number is odd" if the number is odd. To do this, I am using the binary operator "%" in order to find out whether the number imputed is even or odd. The problem is that I keep getting this error that says: "error: binary operator '%' cannot be applied to operands of type 'String?' and 'Int' if  a %  2 ==  0". I do not know how to make the user input become an Int value instead of the default String so that the binary operator will work.</p>
  
  <p>I have been suggested to try Type Casting, but nothing I do seems to be working.</p>
  
  <pre><code>print("This code will inform you whether the number you input is odd or even.")
  
  print("Please enter a number of your choice.")
  
  var a = readLine()
  
  if  a %  2 ==  0 {
     print("This number is even.")
  }
  else  {
     print("This number is odd.")
  }
  </code></pre>
  
  <p>I expect the user to be able to input a number and the computer to tell the user whether the number is odd or even. </p>