Test Informed Learning with Examples

Logo

Repository with assignments using the Test Informed Learning with Examples (TILE) method to integrate testing into existing programming courses for free.

Menu

Odd or even

Write a program that reads an integer number and tells whether it is odd or even. Run the following examples to test that your program gives the same outputs:

>>> %Run 
    Enter an integer number: 1
    The number 1 is odd
>>> %Run 
    Enter an integer number: 0
    The number 0 is even
>>> %Run 
    Enter an integer number:111
    The number 1 is odd
>>> %Run 
    Enter an integer number: 23
    The number 23 is odd
>>> %Run 
    Enter an integer number: -34
    The number 0 is even
>>> %Run 
    Enter an integer number: -11
    The number -11 is odd
Insist that the students test their programs by giving them example
test executions.