int calculateHeight(int width,double ratio){
  if (ratio == 0) {
    return 0;
  }
  return (int)Math.round(width / ratio);
}

int calculateHeight ( int width , double ratio ) { if ( ratio == 0 ) { return 0 ; } return ( int ) Math . round ( width / ratio ) ; }
returns the height that will satisfy the width to height aspect ratio , keeping the given width fixed .
