Department of Computer Science

Problem Solving and Algorithm Design I

Spring Semester 2010

Dr. Maury Eggen

Homework Laboratory Exercise 5

For this homework assignment we shall study the use of functions, while loops, and if-else for decisions. We shall also study the properties of positive integers.

You are to write a program which will prompt the user to enter a positive integer. Your code must make sure that the integer is positive. You must then define functions which will determine the following:

We recall from class discussion that each of the tasks of the problem must be handled by its own separate function. Functions must communicate appropriate results amongst themselves. Functions should be single purpose entities. You must decide what the inputs to the functions are, what the outputs from the function will be, and whether or not the functions have any side effects, like printing to the screen. (Generally this task is left to a display function).

Your homework submission must include:

Program due date is Wednesday, February 10, 2010

Return to Dr. Eggen's Home Page