/******************************************************************************
*  Example of data type casting                          
******************************************************************************/
public class cast 
{
    public static void main(String[] args) 
    {
        int total = 23951;
        int num = 12;
        float avg  = total / num;                       // integer division
        float avg2 = (float) total / num;               // casting to a (float) 

        System.out.println(total + " divided by " + num);
        System.out.println("without casting: " + avg);
        System.out.println("with casting...: " + avg2);

        double rand = Math.random();
        int dice = (int) (rand * 6 + 1);                //casting to an integer

        System.out.println();
        System.out.println("The random number is: " + rand);
        System.out.println("The dice is showing.: " + dice);

    }
}