Intermediate Business Programming with C++

Specification:

For an example of a more complete program, suppose you wanted to create a program that receives the student's name, the number tests to average, the grade on each test and then it would calculate the average of this indeterminate number of grades for a student. It should then display the average on the screen with the student's name.

The specification document should contain samples of the input screen and the output screen. Make up a sample input and a sample output screen to meet this requirement.

In addition to the sample data, the specification document should contain sufficient data samples to adequately test the program in the Design, the Coding and the Testing Phase. (Make up some possible values to use for hand testing in the Design Phase, the Coding Phase and for use in the Testing Phase when the program is run.)

Design:

Before you look at the examples, try to create each of the design parts on your own.

Coding:

Before you look at the example program, try to write the program on your own.

You do not have to store the result of the division in a variable as was done in the pseudo code. The quotient itself could be the output. This will save memory and the time used for the transfer of data to and from the stack memory.

In the above program, the prototype of the function calculateAverage( ) was the declaration and it appears above the function main( ) in which it is called. The definition of calculateAverage( ) was listed after main( ). Remember that the program could be written so that the definition of calculateAverage( ) appeared above main( ). In this way there would be no need for the prototype.

Testing:

Copy this program into your compiler, compile and run it using the test values you developed in the Specification Phase above. In a software company or in the IT department of a large corporation, the Testing Phase would be handled by the Testing/Quality Assurance team.

Maintenance:

What types of changes would you anticipate? Should you make these changes now or wait until you are requested by the user? The answer to this question would depend on the circumstances but be careful of developing modifications that are not requested by the stackholders.

Категории