← Back to Miscellaneous
Question 168
DecimalFormat Scientific Notation
DecimalFormat Scientific Notation
Use DecimalFormat to read a number and format it in scientific notation with exactly 2 decimal places.
The 'E' in a DecimalFormat pattern triggers scientific notation. The pattern '0.00E0' produces 1 digit before the decimal, 2 after, and the base-10 exponent after E. So 12345 becomes 1.23E4.
⚠️ AUTO-INPUT MODE: The input stream will automatically contain '12345\n'. Use Scanner's nextDouble() to read it.Expected Output:
Sci: 1.23E4= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
Miscellaneous
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.