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:    
12:    
13: 
14: #include <iostream>
15: 
16: using namespace std;
17: 
18:    
19: 
20: int main()
21: {  
22:    double bottles;
23: 
24:    cout << "How many bottles do you have? ";
25:    cin >> bottles;
26: 
27:    double cans;
28:    cout << "How many cans do you have? ";
29:    cin >> cans;
30: 
31:    const double BOTTLE_VOLUME = 2.0;
32:    const double CAN_VOLUME = 0.355;
33:    double total = bottles * BOTTLE_VOLUME + cans * CAN_VOLUME;
34: 
35:    cout << "The total volume is " << total << " liter.\n";
36: 
37:    return 0;
38: }