Final answer:
An if-statement to throw an IllegalArgumentException when x is less than zero can be written as: if (x < 0) { throw new IllegalArgumentException("x must not be less than zero."); }
Step-by-step explanation:
The student has asked for an if-statement to throw an IllegalArgumentException when a variable x, which is of type double, is less than zero.
Here is how you can write the if-statement in Java:
if (x < 0) {
throw new IllegalArgumentException("x must not be less than zero.");
}
It is important to use exception handling responsibly by providing a clear message indicating the reason the exception is being thrown.