Use double when you need fractional values - averages, percentages, geometry calculations, or any division that should not truncate. If you divide two int values, C++ gives you an int result.
7 / 2 equals 3, not 3.5. Use 7.0 / 2.0 or double(7) / 2 to get the decimal. Avoid double for counting or indexing. Use int or long long when values are always whole numbers - it is faster and avoids precision errors.