Write a java program that will prompt the user for a positive integer(num) and then display two triangles with num numbers of lines to represent the following pattern of asterisks.The input num must be validated , and if invalid , the user must be allowed a maximum of 3 tries to enter the correct value.