Program 1.5 Casting to get a random integer public class RandomInt public static void main(String args) int n = Integer . parseInt(args [0]) ; double…