|
|
|
|
|
|
|
number of pieces to get the volume in cubic inches. You would divide this quantity by the volume of one full sheet (4608 cubic inches) to get the number of sheets. |
|
|
|
|
|
|
|
|
The process can be translated directly into a program. Read the letter and four numbers becomes an input statement. We use an If-Then-Else statement to examine the letter and decide which formula to use. Each branch of the If-Then-Else has two steps. In the first, we calculate the appropriate result. In the second, we print the result and say whether it is in board feet or full sheets. |
|
|
|
|
|
|
|
|
Get data
IF code equals 'L'
Calculate lumber amount
ELSE
Calculate plywood amount |
|
|
|
|
|
|
|
|
|
|
Prompt for input
Read code, size1, size2, size3, numOrdered
Echo-print input data |
|
|
|
|
|
|
|
|
|
|
|
Set boardFeet = size1 * size2 * size3 * 12 * numOrdered / BOARD_FT_INCHES
Print boardFeet |
|
|
|
|
|
|
|
|
|
|
|
Set fullSheets = size1 / size2 * size3 * 12 * WIDTH_INCHES * numOrdered / PLYWOOD_INCHES
Print fullSheets |
|
|
|
|
|
|
|