Advertisement
GoodiesHQ

Untitled

Feb 8th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. enum bottle_state {
  5.     FULL,
  6.     HALF,
  7.     TOTAL,
  8.     NUM_ELEMENTS
  9. };
  10.  
  11. int main(){
  12.     const double LITERS_PER_GALLON = 3.785;
  13.     const double POUNDS_PER_GALLON = 8.348;
  14.     const double POUNDS_PER_CONTAINER = 0.5 / 16;
  15.     const int CASE_PER_PALLET = 80;
  16.     const int BOTTLES_PER_CASE = 24;
  17.  
  18.     // create an array holding the number of full and half bottles that the user would like
  19.     int *bottles = new int[bottle_state::NUM_ELEMENTS];
  20.     std::cout << "Number of full pallets: ";
  21.     std::cin >> bottles[FULL];
  22.     std::cout << "Number of half pallets: ";
  23.     std::cin >> bottles[HALF];
  24.     bottles[TOTAL] = bottles[HALF] + bottles[FULL];
  25.     // servings count is equal to the number of bottles
  26.  
  27.     system("pause");
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement