Question 1:
To create a LightSequence object `gradShow` with the initial light sequence "0101 0101 0101", you can use the following statement:
```java
LightSequence gradShow = new LightSequence("0101 0101 0101");
```
Question 2:
To call the `display` method and display the light sequence for the `gradShow` object, you can use the following statement:
```java
gradShow.display();
```
Question 3:
To update the light sequence of the `gradShow` object to "0011 0011 0011", you can use the following statement:
```java
gradShow.changeSequence("0011 0011 0011");
```
Question 4:
To call the `insertSegment` method and insert the segment "1111 1111" in the current sequence for `gradShow` at index 4, and store the resulting sequence in the string `resultSeq`, you can use the following code segment:
```java
String resultSeq = gradShow.insertSegment("1111 1111", 4);
```
Question 5:
To remove the first occurrence of the string `segment` from `oldSeq` and store it in the string `newSeq`, you can use the following code segment:
```java
String newSeq = oldSeq.replaceFirst(segment, "");
```
Question 6:
To calculate and print the straight-line distance between two lights based on the vertical distance stored in the double variable `a` and the horizontal distance stored in the double variable `b`, you can use the following code segment:
```java
double distance = Math.sqrt(a*a + b*b);
System.out.println("The straight-line distance between the two lights is: " + distance);
```
This code segment calculates the distance using the formula `Math.sqrt(a*a + b*b)` and then prints the result using `System.out.println()`.