01: /****************************************************************************
02: ** COPYRIGHT (C):    1998 Cay S. Horstmann. All Rights Reserved.
03: ** PROJECT:          Computing Concepts with C++ 2E
04: ** FILE:             volume2.cpp
05: ** NOTE TO STUDENTS: This file has been edited to be compatible with older
06: ** compilers. If your compiler fully supports the ANSI/ISO C++
07: ** standard, remove the line #include "ccc_ansi.cpp". You can also remove
08: ** the lines #ifndef CCC_ANSI_H and #endif
09: ****************************************************************************/
10: 
11:    #include "ccc_ansi.cpp"
12:    #ifndef CCC_ANSI_H
13: 
14: #include <iostream>
15: 
16: using namespace std;
17: 
18:    #endif
19: 
20: int main()
21: {  double bottles;
22: 
23:         cout << "How many bottles do you have? ";
24:         cin >> bottles;
25: 
26:    double cans;
27:         cout << "How many cans do you have? ";
28:         cin >> cans;
29: 
30:    const double BOTTLE_VOLUME = 2.0;
31:    const double CAN_VOLUME = 0.355;
32:    double total = bottles * BOTTLE_VOLUME + cans * CAN_VOLUME;
33: 
34:         cout << "The total volume is " << total << " liter.\n";
35: 
36:    return 0;
37: }