Computer Science Using C++

Ch. 14 Programming Assignment Part II

  1. Ch14Proj2

    Write a C++ program that reads nine integer values from 9 separate lines of an external text file named Ch14Proj2data.txt. (See the hyperlink for an example of this text file.) The file is located in the same folder as your source file. As soon as the program reads the first three values, it should compute and display the average of those three values. After reading the sixth value, it should display the average of the second set of three integers. It should display the average of the last three integers after reading them. Finally, the program must also display the overall average value of all nine values with a suitable message. All averages must be displayed in fixed notation rounded (not truncated) to the nearest hundredth's place. Use one or more loops in this program so that it can be easily upgraded if more than 9 integers were placed in the text file. Therefore, you must use very careful design for this assignment in order to receive a high grade. Avoid using brute force! You must also store the values into an apvector as they are read from the file.

    Preconditions:


    Your program must follow the Wyo Area Comp Sci Documentation & Coding Standards. Place a copy of Ch14Proj2.cpp in your Submit folder so that the instructor can execute your program within that folder. Also place a copy of the text file, Ch14Proj2data.txt

    You must hand in the following on separate pages stapled in this specified order:
    1. The hardcopy source code for this assignment. Staple multiple pages together, if applicable.
    2. The typed pseudocode that you used to write out your C++ code. Please type this neatly following the specified template.
    3. The typed test plan (following the Excel template) that you developed before writing out the code. The test plan must include several reasonable inputs as well as boundary and any other special values. You should include as many test cases as necessary so that the test plan is thorough.


    Here is an example test plan item:


Computer Science Using C++ Home Page | Mr. Minich's Wyo Home Page