Program Planner
What is the main purpose of your program?
To determine if a number is odd or even
What is the output for your program?
It will return the string "Even" if the number is even, or "Odd" if the number is odd
What is the input needed to get that output?
An integer number
What steps are required to convert the input into the output (algorithm)?
the number input modulus 2
if the remainder is 0 then the output is "Even"
otherwise the output is "Odd"
How will you test that the output is correct?
I will enter an even number to make sure the output is correct, then I will enter an odd number to determine the same.
A non integer number will crash the program
What objects will you use?
Console and Integer
Additionally I will ask you to put a comment header on every program that tells what the assignment is, a brief description of the program, your name and the date. It will look something like this:
/*********************************
* Assignment x
* This program determines if a number
* is even or odd
* Steve Conger
* September 30, 2010
***********************************/
No comments:
Post a Comment