< previous page page_236 next page >

Page 236
Value of
c
s
s
s
n
b
f
o
i
i
i
u
o
u
d
z
z
z
m
a
l
e
e
e
e
o
r
l
1
2
3
r
d
s
d
F
h
e
e
e
r
e
e
e
t
t
Statement
d
s
cout << "Enter letter code, three integer""dimensions, and quantity ordered:" < endl;
__
__
__
__
__
__
__
cin >> code >> size1 >> size2 >> size3 >> numOrdered;
P
1
2
8
20
-
-
cout << "For the order data:" < endl;
P
1
2
8
20
-
-
cout << code < ' ' < size1 < ' ' < size2 < ' ' < size3 < ' ' < numOrdered < endl;
P
1
2
8
20
-
-
if ( ! (code == 'L' | | code == 'P') ) cout << "The item code is invalid." < endl;
P
1
2
8
20
if (code == 'L')
P
1
2
8
20
-
-
{
// Calculate lumber amount
boardFeet = float(size1 * size2 * size3 * 12 * numOrdered) / BOARD_FT_INCHES;
-
-
-
-
-
-
-
cout << "the board-foot equivalent is" < setprecision (2) < boardFeet < endl;
-
-
-
-
-
}
if (code == 'P')
P
1
2
8
20
-
-
{
// Calculate plywood amount
fullSheets = float(size1) / float(size2) * float(size3 * 12 * WIDTH_INCHES *
numOrdered) / PLYWOOD_INCHES;
P
1
2
8
20
-
10.0
cout << "the full-sheet equivalent is" < setprecision(2) < fullSheets < endl;
P
1
2
8
20
-
10.0
}
return 0;
P
1
2
8
20
-
10.0

 
< previous page page_236 next page >