Describe an algorithm for determining whether an arbitrary year happens to be a Leap Year; the first instruction should be something like, "Input the value for year." Your algorithm should be able to handle any year above 1599. So, for example, your algorithm should say LEAP YEAR for years like 1996 and 2000, and it should say NOT A LEAP YEAR for years like 1700, 1800, 1900, and 1995.
Describe an algorithm for determining whether any given (positive) whole number is a prime; the first instruction should be something like, "Input a value for number". For example, for inputs 23 and 61, your algorithm should say PRIME, but for inputs 1, 12, and 35, it should say NOT PRIME.
Describe an algorithm for determining whether the letters of a given word happen to be in alphabetical order; the first instruction should be something like, "Input word." For example, your algorithm should say ALPHABETICAL for words like ACT and ADS, and NOT ALPHABETICAL for words like CATS and DOGS.
To express your algorithms, use the numbered-list-of-instructions style that was used in lecture for the change-making, gcd, and square root algorithms. To get a sense of whether your algorithms are comprehensible, give them to another mathematically-inclined human (e.g., a lab T.A., or a computer science major who's not in this class), and verify that he/she is able to perform each instruction in the way that you intended; if not, rewrite the instruction in a more clear way.
Revised at 23:50 on 16 September 2009