Hello! Tell me by the code, it is correctly designed by the task.
Task.
Create a program that will check whether an integer randomly selected from the [5; 155] segment is in the interval (35; 150) and report the result to the screen
public class Test { public static void main(String args[]){ final int a = 5; final int b = 155; int c = (int) (Math.random()*a + Math.random()*b); if(c >= 35 && c <= 150){ System.out.println("Число " + c + " содержится в интервале (35,150)"); } else{ System.out.println("Число " + c + " не содержится в интервале (35,150)"); } } }