/* Chapter 2, dweight.c program (page 19) */ 
/* Comments added */

/* Computes the dimensional weight of a 12" x 10" x 8" box */

#include <stdio.h>

main()
{
  int height, length, width, volume, weight;     // Declare variables
   
  height = 8;                                    // Set the box's height
  length = 12;                                   // Set the box's length
  width = 10;                                    // Set the box's width

  volume = height * length * width;              // Calculate cubic inches

  weight = (volume + 165) / 166;                 // Determine weight (round up)
  
  // Tell the user what we've found out

  printf("Dimensions: %dx%dx%d\n", length, width, height);
  printf("Volume (cubic inches): %d\n",volume);
  printf("Dimensional weight (pounds): %d\n",weight);
  
  return(0);
}

