// ifElse1.cc 
// Example program showing how if else selection statements work in C++
// Michael Haggerty for CISC105
#include <iostream>

using namespace std;

// The bool variable type is only true or false!
bool isEven(int value);

int main()
{
   int x;
   cout << "Please enter a number from 1 to 100: ";
   cin >> x;
   
   if (isEven(x)) // Why do you think this works?
      cout << "You entered an even Number!\n";
   
   if ((x >= 1) && (x <= 100))
      cout << "You followed directions...  Very Good!" << endl;
   else
      cout << "*****ERROR***** - Next time please follow directions" << endl;
   
   return 0;
}

// funtion isEven(int value)
// Returns true if value is even otherwise false
// Input: a number
// Output:  A true|false value
bool isEven(int value)
{
   if ((value%2) == 0) // in C++ the % is the modulus operator!
      return true;
   else
      return false;
}