TW2 - Odd Numbers


TeamIconBlue.png

Odd Numbers

All Teamwork (TW)


Instructions

Blue Teams; expected time to complete 1-2 hour.

From three integers, x, y, and z, pick the highest one that is odd (or output a message that they are all even).

    BulletArrowsBlue.png

    Quiz TW2: Step-by-Step is to be filled out individually by each team member during the team session.

    • This quiz will walk you through the details step-by-step.

    BulletArrowsBlue.png

    TW2: Group Submission is to be handed in for the whole team by the team leader.

    • Hand in tw2_max_odd.py.

    Start by solving the finger exercise from the Guttag book on page 18:

    From three integers, x, y, and z pick the highest one that is odd (or output a message that they are all even).

    For x, y, and z, have the user input those integers with suitable prompts naming the variables for the user. Your message should say which one is the highest odd (both its value and whether it was x, y, or z). For instance:

    Enter three integers for x, y, and z.
    x: 100
    y: -3
    z: 14
    The highest odd was y, -3.

    Make sure you test all possible distinct cases. How many are there? Here's a partial list:

    • all are even,
    • x is the only odd,
    • y is the only odd,
    • z is the only odd,
    • x is the only even and y is the greater of the other two,
    • x is the only even and z is the greater of the other two,
    • etc.

    Make sure to include all the authors in the module's docstring and a good description. Use good style, including well-named variables, spaces around operators (like = % +, etc.), and have reasonable comments where a human reader of your program might need a little explanation of what you are doing (or how). Don't be too verbose, but don't be too laconic either!

    Guidance Arrow-left-horizontal-blue.png

    Start with something simpler! Have a program that just does x and y. Then add z after that is working.