Module: (Java) Variables. Output formats


Problem

7/7

Training: output a real number

Theory Click to read/hide

To ensure that the output of a real number is guaranteed with a dot as a separator, you must use the American layout, which is connected using:

  Locale.setDefault(Locale.US);

Problem

This is an optional task for those who want to learn more about the Java output operator.

In the 4th line, write an operator that, when substituted into the specified line, performs the output of the value of the variable a with a sign and with an accuracy of 3 decimal places