|
|
|
|
|
|
|
else
{
// Calculate plywood amount
fullSheets = float(sizel) / float(size2) *
float(size3 * 12 * WIDTH_INCHES * numOrdered) /
PLYWOOD_INCHES;
cout << the full-sheet equivalent is
< setprecision(2) < fullSheets < endl;
}
return 0;
} |
|
|
|
|
|
|
|
|
This is a sample run of the program: |
|
|
|
|
|
|
|
|
Enter letter code, three integer dimensions, and quantity ordered:
L 2 6 10 45 For the order data: L 2 6 10 45 the board-foot equivalent is 450.00 |
|
|
|
|
|
|
|
|
This sample shows what happens when code is P: |
|
|
|
|
|
|
|
|
Enter letter code, three integer dimensions, and quantity ordered:
P 1 2 9 7
For the order data:
P 1 2 9 7
the full-sheet equivalent is 3.94 |
|
|
|
|
|
|
|
|
We examine this program in more detail in the next section. |
|
|
|
|
|
|
|
|
In Chapter 1, we discussed the problem-solving and implementation phases of computer programming. Testing is an integral part of both phases. Here we test both phases of the process used to develop the LumberYard program. Testing in the problem-solving phase is done after the solution is developed but before it is implemented. In the implementation phase, we test after the algorithm is translated into a program, and again after the program has compiled successfully. The compilation itself constitutes another stage of testing that is performed automatically. |
|
|
|
|
|