SOURCE FILE: askPermission.pseudo


Pseudo Code

/* ************************************************************ */
/*                         askPermission                        */
/* ************************************************************ */
/*

      This function prints a prompt to the screen and inputs
      a character from the user.  It returns true if the
      character is 'y', and it returns false if the
      character is 'n'.
*/
int askPermission ()
{

      /* Declare a char variable ('answer' is a possible
	 name) to store what the user types */

     /* Print a prompt to the screen, asking the user if
	s/he would like to do a tiling, using an image in a
	file as the tile. */

     /* Read the response from the user into the char
     variable. */

     /* Return true if the value of the variable is 'y',
	else return false. */
}

Notes: 

* Statements that write to the screen start out like this:
  cout <<

  Example: cout << "This is a message you could print out " ;

* Statements that read from the keyboard start out like
  this: cin >>

  Example: cin >> response_string ;

* You return a value by just using the keyword: return
  followed by whatever value you want to return.

  Example: return true ;

  The return statement has a number of effects:
     + Execution of function askPermission terminates
     + if a statement like this

           x = askPermission () ;

       was used to call askPermission, then the return value
       (in this case:  true gets stored in the variable x

     + execution of the caller (in this case, main) resumes
       at the next statement after the call to
       askPermission.