Homework 4


50 pts., due Mar. 22

For each program, you should turn in the source code and a print-out showing a sample run (print the output window). Follow the guidelines in Section 3.7 for the style of your programs. In addition:

  1. Use descriptive names for variables and named constants. In addition, write a brief comment for each variable and named constant describing how it is used.
  2. Use uppercase characters for named constants with underscores to separate ``words.'' Use lowercase characters for variables with either underscores or capitalization to separate ``words.''
  3. If a formula you use in a statement isn't obvious, comment it. In general, comment any non-obvious statement or statement block.

Documentation will account for 30% of your grade.

  1. Write a program which accepts as input a single integer value and outputs:

    Here is sample input and output:

    The number please: 17
    17: prime.
    The number please: 60
    60: 2 2 3 5

Thomas P. Kelliher
Thu Mar 14 13:31:55 EST 1996
Tom Kelliher