This preview shows page 1. Sign up to view the full content.
Unformatted text preview: // post: result == a <= b and b <= c) void Sort (int &a, int &b, int &c) // pre: a, b, c are integers // post: the value of a,b, and c are rearranged so that a <= b and b <= c Part 2 -- Drive your functions Develop a driver program for your functions. The driver should allow you to test its correctness for a variety of initial arrangements of the values of three integers (x,y, and z) Questions 1. Using just 1's, 2's, and 3's, list all the different ways of rearranging these values that would provide distinct tests for these functions. 2. Consider the entire range of integers that can possibly be supplied to these functions, how many different cases would there be if you were to make an exhaustive test for correctness? Is such an exhaustive test necessary to assure that the functions satisfy their specifications? Explain. 3. Can the function Sort be equivalently rewritten as a "function"? Explain. You're done!...
View Full Document
This note was uploaded on 03/31/2010 for the course CPSC 1301 taught by Professor Khan,s during the Spring '08 term at Columbus State University.
- Spring '08