1. Leap Year
Input a year N (0 < N < 2999), output ‘Leap year’ if year N is a leap year, output ‘Not leap year’ if year N is not a leap year; Note that year N is a leap year if N is divisible by 4 AND N is not divisible by 100; However year N is always a leap year if N is divisible by 400.
Extension 1:
Output 'almost leap year' if N divisible by 4 but not actually a leap year.
2. Parallelogram
Input an integer N and an integer M (0 < N, M < 20), output a N by M parallelogram. Example, N = 5, M = 4, output is
Extension 1:
Output both the original parallelogram and its mirror image.
Extension 2:
Use ‘*’ and ‘+’ for alternating rows.
3. String operation
Input a string Name, a string Action, an integer Time. Compose a sentence saying some is going to something at some time. Example: Name = “Bryan”, Action = “Sleep”, Time = 22, Output: Bryan is going to Sleep at 22 o’clock.
Extension 1:
Name can contain multiple words separated by ‘and’, in that case you’ll need to use ‘are’ instead of ‘is’.
Extension 2:
Time can be in the past. In that case you’ll need to use ‘was going to’ instead of ‘is going to’. Not they may need to be adapted to plural forms as well.
4. Mind reader:
Your computer tells you it has mind reading capabilities. You certainly don't buy that because you go to the Opportunity Class. Your computer suggests a game with which it will show you that it reads your mind.
You give it a range, like 1..100, and the computer guesses an integer within that range. All you need to do is tell it 'too large' or 'too small'. You two repeat this Q&A until the computer guesses the correct number you have in mind. By doing so you are able to tell if the computer can really read your mind, or it's simply doing maths.
Input 2 integers that indicate the range. For each integer the computer guesses, input 'too large', 'too small', 'correct', or 'quit'. The game ends when the input is 'correct' or 'quit'. The computer outputs the integer you have in mind, and the number of guesses taken. If the computer finds out you are trying to cheat, it also ends guessing and outputs 'you can't fool me!'.