Data Structures
Final Examination
Take home portion

Name _____________________________________________________________

Diskette Contents

Your instructor has given you a diskette that contains four directories each of which contain partial C++ programs.  Your task is to complete these programs.
For each problem it is not necessary for you to compile and execute the program.  However, for problem 2, where you are to find the errors in the code, the compiler will be of significant help to you.  For problems 3 and 4 if you can compile and execute the programs correctly it would be an indication to you that your answers are correct.

The diskette, along with this sheet of instructions, is to be turned in at the beginning of class on May 3rd.  Late take-home exams will be given a grade of zero.
This is an exam.  As such, you are not to receive help from anyone on this work.  You may not work together in any way.  If any of the exams show significant evidence of collaboration all of the collaborating exams will be given a grade of zero.

Problem 1.  In the directory Problem1, there is the file “Problem1.cpp”.  The program will accept an arbitrary number of positive floating point numbers from the key, add those numbers and find their average.  The program will then print the sum and the average onto the screen.  Properly document that program.  “Problem1.cpp” contains no errors.

Problem 2.  In the directory Problem2, there is the file “Problem2.cpp”.  The program will read an arbitrary number of floating point numbers from the file “numbers.txt”, which is included.  The program will then print the number of values read from the file, their sum, and their average.  All of the printing will go to the screen.  “Problem2.cpp” worked properly until your instructor introduced three errors.  You are to find these errors.  Place a comment containing your name at the beginning of the source code.

Problem 3.  In the directory Problem 3, there is the file “Problem3.cpp”.  The program is to copy a text file and write it to another file.  The source file is only an outline of the problem.  Your task is to complete the code.  Place a comment containing your name at the beginning of the source code.

Problem 4.  In the directory Problem 4, there is a file “Problem4.cpp” along with library files “InsertSort.h” and “InsertSort.cpp”.  The two library files are complete.  The main program is to use the library files to time the insert sort on integers.  Problem4.cpp is an outline of that problem.  Your task is to complete the code.  Place a comment containing your name at the beginning of the source code.